From: Alessandro Ghedini Date: Wed, 10 Jul 2013 13:01:36 +0000 (+0200) Subject: vcsh: do not create .gitignore.d if VCSH_GITIGNORE == none X-Git-Url: https://git.madduck.net/code/vcsh.git/commitdiff_plain/809b0acc18fa84089f453bf69a177246bf400bdf?ds=inline;hp=--cc vcsh: do not create .gitignore.d if VCSH_GITIGNORE == none --- 809b0acc18fa84089f453bf69a177246bf400bdf diff --git a/vcsh b/vcsh index 41b0ba6..e74910e 100755 --- a/vcsh +++ b/vcsh @@ -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')