From: martin f. krafft Date: Sat, 2 Nov 2019 08:02:21 +0000 (+1300) Subject: Only run init hook during init X-Git-Url: https://git.madduck.net/etc/vcsh.git/commitdiff_plain/a9ded3e131bc9eb76550e6babe414f9dd990a013?ds=inline;hp=b37d9708ad84dfa19ae40d878f9d354855072fa9 Only run init hook during init --- diff --git a/.config/vcsh/hooks-available/post-init.write-gitignore b/.config/vcsh/hooks-available/post-init.write-gitignore index 012db00..4039ca8 100755 --- a/.config/vcsh/hooks-available/post-init.write-gitignore +++ b/.config/vcsh/hooks-available/post-init.write-gitignore @@ -1,5 +1,9 @@ #!/bin/sh +# only run during an actual init (not when init is called as part of e.g. +# clone). +[ $VCSH_COMMAND = init ] || exit 0 + cd $GIT_WORK_TREE GIT_IGNORE_FILE=.gitignore.d/$VCSH_REPO_NAME