X-Git-Url: https://git.madduck.net/code/vcsh.git/blobdiff_plain/c1b6930b5e9ec3e3871ed04150f100b1ff12aa8f..cf88f08e584bbbbe61f2ee98f3436144eb4edeaf:/vcsh?ds=sidebyside diff --git a/vcsh b/vcsh index f1f50de..b240b60 100755 --- a/vcsh +++ b/vcsh @@ -260,7 +260,7 @@ which() { write_gitignore() { # Don't do anything if the user does not want to write gitignore - if [ "x$VCSH_GITIGNORE" = 'xnone' ] then + if [ "x$VCSH_GITIGNORE" = 'xnone' ]; then info "Not writing gitignore as '\$VCSH_GITIGNORE' is set to 'none'" exit fi @@ -358,9 +358,8 @@ if echo $VCSH_REPO_NAME | grep -q '/'; then export VCSH_REPO_NAME=$(basename "$VCSH_REPO_NAME" .git) fi - -for check_directory in "$VCSH_REPO_D" "$VCSH_BASE/.gitignore.d" -do +check_dir() { + check_directory="$1" if [ ! -d "$check_directory" ]; then if [ -e "$check_directory" ]; then fatal "'$check_directory' exists but is not a directory" 13 @@ -369,7 +368,10 @@ do mkdir -p "$check_directory" || fatal "could not create '$check_directory'" 50 fi fi -done +} + +check_dir "$VCSH_REPO_D" +[ ! "x$VCSH_GITIGNORE" = 'xnone' ] && check_dir "$VCSH_BASE/.gitignore.d" verbose "$VCSH_COMMAND begin" export VCSH_COMMAND=$(echo $VCSH_COMMAND | sed 's/-/_/g')