X-Git-Url: https://git.madduck.net/code/vcsh.git/blobdiff_plain/31149fc284678effd9ab58aaff41c67175e9e866..980cf95c728f02610649fc4dee37a24f00d8dfd3:/vcsh?ds=sidebyside diff --git a/vcsh b/vcsh index bcd416c..d583dbc 100755 --- a/vcsh +++ b/vcsh @@ -214,12 +214,13 @@ elif [ "$VCSH_COMMAND" = 'seed-gitignore' ]; then [ "$file" = "$new" ] && break file="$new" done; - done | sort -u | sed 's/^/!/') + done | sort -u) tempfile=$(mktemp) || (echo "$SELF: fatal: could not create tempfile" && exit 1) echo '*' > "$tempfile" for gitignore in $gitignores; do - echo "$gitignore" >> "$tempfile" + echo "$gitignore" | sed 's/^/!/' >> "$tempfile" + [ -d "$gitignore" ] && echo "$gitignore/*" | sed 's/^/!/'>> "$tempfile" done diff -N "$tempfile" "$HOME/.gitignore.d/$VCSH_REPO_NAME" > /dev/null && rm -f "$tempfile" &&