Skip to content

Commit 3d6f945

Browse files
authored
Merge pull request #962 from spacewander/gicc
tweak git-ignore/ignore-io
2 parents 42458d8 + 27ee8f0 commit 3d6f945

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

bin/git-ignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,10 @@ function add_private {
5757
function add_patterns {
5858
echo "Adding pattern(s) to: $1"
5959
local file="${1/#~/$HOME}"
60+
dir_name=$(dirname "$file")
61+
if [ ! -d "$dir_name" ]; then
62+
mkdir -p "$dir_name"
63+
fi
6064
if [ -s "$file" ]; then
6165
# If the content of $file doesn't end with a newline, add one
6266
test "$(tail -c 1 "$file")" != "" && echo "" >> "$file"

bin/git-ignore-io

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ show_usage() {
8585
check_list_exist() {
8686
if ! [ -f "$default_path" ]; then
8787
echo "-----Initial gitignore.io list----"
88-
update_gi_list &
88+
update_gi_list
8989
echo "-----Save to $default_path-----"
9090
echo
9191
fi

0 commit comments

Comments
 (0)