X-Git-Url: https://git.madduck.net/code/vcsh.git/blobdiff_plain/77afd689e3bbc0ada1cadd2ed55d2adb65c9aebb..7f6ab9a128b7848186a9a36580011a97253f70c8:/vcsh diff --git a/vcsh b/vcsh index 015d47a..c6ea395 100755 --- a/vcsh +++ b/vcsh @@ -22,9 +22,9 @@ help() { clone \\ [] Clone from an existing repository - help Display this help text delete Delete an existing repository enter Enter repository; spawn new instance of \$SHELL + help Display this help text init Initialize a new repository list List all repositories list-tracked List all files tracked by vcsh @@ -101,7 +101,7 @@ To continue, type 'Yes, do as I say'" for file in $files; do rm -f $file || info "could not delete '$file', continuing with deletion" done - rmdir "$GIT_DIR" || error "could not delete '$GIT_DIR'" + rm -r "$GIT_DIR" || error "could not delete '$GIT_DIR'" } enter() { @@ -133,8 +133,8 @@ init() { } list() { - for i in "$VCSH_REPO_D"/*.git; do - echo $(basename "$i" .git) + for repo in "$VCSH_REPO_D"/*.git; do + [ -r "$repo" ] && echo $(basename "$repo" .git) done } @@ -228,7 +228,7 @@ if [ ! "x$VCSH_GITIGNORE" = 'xexact' ] && [ ! "x$VCSH_GITIGNORE" = 'xrecursive' fi if [ "$1" = 'clone' ]; then - [ -z $2 ] && fatal "$1: please specify a remote" 1 + [ -z "$2" ] && fatal "$1: please specify a remote" 1 export VCSH_COMMAND="$1" GIT_REMOTE="$2" [ -n "$3" ] && VCSH_REPO_NAME="$3" || VCSH_REPO_NAME=$(basename "$GIT_REMOTE" .git) @@ -298,5 +298,7 @@ done verbose "$VCSH_COMMAND begin" export VCSH_COMMAND=$(echo $VCSH_COMMAND | sed 's/-/_/g') +hook pre-command $VCSH_COMMAND +hook post-command verbose "$VCSH_COMMAND end, exiting"