X-Git-Url: https://git.madduck.net/code/vcsh.git/blobdiff_plain/b67f39a96f50708015c0986e741cfe621f255593..68c93dceb42ee275b339d421bbf77eaf62363d31:/vcsh diff --git a/vcsh b/vcsh index ee35141..cfcb42a 100755 --- a/vcsh +++ b/vcsh @@ -48,7 +48,7 @@ info() { echo "$SELF: info: $1" } -clone () { +clone() { init git remote add origin "$GIT_REMOTE" git config branch.master.remote origin @@ -65,7 +65,7 @@ clone () { git merge origin/master } -delete () { +delete() { old_dir="$PWD" cd "$HOME" use @@ -86,7 +86,7 @@ To continue, type \"Yes, do as I say\"" cd "$old_dir" } -enter () { +enter() { use $SHELL } @@ -96,23 +96,22 @@ init() { export GIT_WORK_TREE="$HOME" mkdir -p "$GIT_WORK_TREE" cd "$GIT_WORK_TREE" || fatal "could not enter '$GIT_WORK_TREE'" 11 - cd "$GIT_WORK_TREE" git init setup } -list () { +list() { for i in "$VCSH_BASE"/*.git; do echo $(basename "$i" .git) done } -run () { +run() { use $VCSH_EXTERNAL_COMMAND } -seed_gitignore () { +seed_gitignore() { use # Switching directory as this has to be executed from $HOME to be of any use. # Going back into old directory at the end in case `vcsh use` is reactivated. @@ -179,8 +178,8 @@ elif [ "$1" = 'delete' ] || export VCSH_COMMAND="$1" export VCSH_REPO_NAME="$2" export GIT_DIR="$VCSH_BASE/$VCSH_REPO_NAME.git" - [ "$1" = 'run' ] && shift 2 && export VCSH_EXTERNAL_COMMAND="$@" - [ "$1" = 'seed-gitignore' ] && export VCSH_COMMAND=seed_gitignore + [ "$VCSH_COMMAND" = 'run' ] && shift 2 && export VCSH_EXTERNAL_COMMAND="$@" + [ "$VCSH_COMMAND" = 'seed-gitignore' ] && export VCSH_COMMAND='seed_gitignore' elif [ "$1" = 'list' ]; then export VCSH_COMMAND="$1" elif [ -n "$1" ]; then