X-Git-Url: https://git.madduck.net/code/vcsh.git/blobdiff_plain/d4326c2c1c2d5e9626f8d9e2ba0e5e3848772238..a647670d3b96ecffd082347638c32dee151a4f12:/vcsh?ds=sidebyside diff --git a/vcsh b/vcsh index 50c1c31..a6d0106 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,10 +65,10 @@ clone () { git merge origin/master } -delete () { +delete() { old_dir="$PWD" cd "$HOME" - use || exit $? + use info "This operation WILL DETROY DATA!" files=$(git ls-files) echo "These files will be deleted: @@ -86,8 +86,8 @@ To continue, type \"Yes, do as I say\"" cd "$old_dir" } -enter () { - use || exit $? +enter() { + use $SHELL } @@ -101,19 +101,19 @@ init() { setup } -list () { +list() { for i in "$VCSH_BASE"/*.git; do echo $(basename "$i" .git) done } -run () { - use || exit $? +run() { + use $VCSH_EXTERNAL_COMMAND } -seed_gitignore () { - use || exit $? +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. old_dir="$PWD" @@ -155,8 +155,7 @@ setup() { use() { if [ ! -d "$GIT_DIR" ]; then - error "no repository found for '$VCSH_REPO_NAME'" - return 12 + fatal "no repository found for '$VCSH_REPO_NAME'" 12 fi export GIT_WORK_TREE="$(git config --get core.worktree)" export VCSH_DIRECTORY="$VCSH_REPO_NAME"