From 5207676adafc1c1e8eb62a24448cb24fdd509451 Mon Sep 17 00:00:00 2001 From: Trevor Batley Date: Tue, 6 Jun 2023 20:19:09 +1000 Subject: [PATCH] cant rm whilst in the directory... --- git-get-repo-and-build.sh | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/git-get-repo-and-build.sh b/git-get-repo-and-build.sh index 4fae496..2fb6d96 100755 --- a/git-get-repo-and-build.sh +++ b/git-get-repo-and-build.sh @@ -100,11 +100,13 @@ if [ "$RESPONSE" == "200" ]; then if [ $DEBUG ] ; then echo "Repository for $ORG_NAME/$REPO_NAME exists!" ; fi else if [ $DEBUG ] ; then echo "Repository for $ORG_NAME/$REPO_NAME does not exist" ; fi - logname="git-cvs2git-create-$ORG_NAME-$REPO_NAME-$(date +'%FT%H%M').log" while true; do read -p "Do you wish to run git-cvs2git?(y/n) " yn case $yn in - [Yy]* ) git-cvs2git.sh "$REPO_NAME" "$ORG_NAME" > $logname; break;; + [Yy]* ) + logname="git-cvs2git-create-$ORG_NAME-$REPO_NAME-$(date +'%FT%H%M').log" + git-cvs2git.sh "$REPO_NAME" "$ORG_NAME" > $logname + break;; [Nn]* ) exit;; * ) echo "Please answer yes or no.";; esac @@ -120,20 +122,17 @@ else fi # Ok, we have a repo!! cd $GITFiles -echo $GITFiles +if [ $DEBUG ] ; then echo $GITFiles ; fi # Delete it if these already if [[ -d $REPO_NAME ]] ; then # Should delete everything.... - cd $GITFiles/$REPO_NAME if [ $DEBUG ] ; then echo "Deleting all files in $GITFiles/$REPO_NAME" ; fi - rm -rf "$REPO_NAME" + rm -rf "$GITFiles/$REPO_NAME" fi -cd $GITFiles git clone "$REPOURL" $QUIET - cd $GITFiles -if [[ ! -d $REPO_NAME ]] ; then +if [[ ! -d $GITFiles/$REPO_NAME ]] ; then echo "git clone has not created the $REPO_NAME directory" exit 1 fi