We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 42458d8 commit 678a0c2Copy full SHA for 678a0c2
bin/git-ignore
@@ -57,6 +57,10 @@ function add_private {
57
function add_patterns {
58
echo "Adding pattern(s) to: $1"
59
local file="${1/#~/$HOME}"
60
+ dir_name=$(dirname "$file")
61
+ if [ ! -d "$dir_name" ]; then
62
+ mkdir -p "$dir_name"
63
+ fi
64
if [ -s "$file" ]; then
65
# If the content of $file doesn't end with a newline, add one
66
test "$(tail -c 1 "$file")" != "" && echo "" >> "$file"
0 commit comments