X-Git-Url: https://git.madduck.net/code/vcsh.git/blobdiff_plain/d71f32cb391997d7fe0509fa0dfbf83fc3762eb9..9fe9f7d5a182830bf4c71e2c1143cbba9ff12488:/vcsh?ds=sidebyside diff --git a/vcsh b/vcsh index 23f8453..d0e7b37 100755 --- a/vcsh +++ b/vcsh @@ -33,16 +33,15 @@ verbose() { help() { echo "usage: $SELF + clone \\ + [] Clone from an existing repository help Display this help - + delete Delete an existing repository + init Initialize a new repository list List all repos - run \\ Use this repository - init Initialize a new repository - clone \\ - [] Clone from an existing repository seed-gitignore \\ Seed .gitignore.d/ from git ls-files" >&2 } @@ -215,11 +214,10 @@ elif [ "$1" = 'delete' ]; then verbose "delete begin" REPO_NAME=$2 [ -z $REPO_NAME ] && help && echo && echo "$SELF $1: error: please specify repository to work on" && return 0 + old_dir="$PWD" + cd "$HOME" use $REPO_NAME || return 1 echo "$SELF: info: This operation WILL DETROY DATA!" - echo -n "Continue? Anything other than 'y' will abort. " - read answer - [ x$answer = x"y" ] || exit files=$(git ls-files) echo "These files would be deleted: @@ -233,6 +231,7 @@ To continue, type \"Yes, do as I say\"" rm -f $file || echo "$SELF: info: could not delete '$file', continuing with deletion" done rm -rf "$VCSH_BASE/$REPO_NAME.git" || echo "$SELF: info: could not delete '$VCSH_BASE/$REPO_NAME.git'" + cd "$old_dir" verbose "delete end"