Skip to content

Commit

Permalink
Merge pull request #276 from spacewander/master
Browse files Browse the repository at this point in the history
git-ignore will cd root to find .gitignore.
  • Loading branch information
hemanth committed Nov 20, 2014
2 parents cb0e566 + 0374044 commit e7990ed
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion bin/git-ignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
#!/usr/bin/env bash

function show_contents {
test -f "$2" && echo "$1 gitignore: $2" && cat "$2"
if [ -f "$2" ]; then
echo "$1 gitignore: $2" && cat "$2"
else
echo "There is not $1 .gitignore yet"
fi
}

function show_global {
Expand All @@ -13,10 +17,12 @@ function add_global {
}

function show_local {
cd "$(git root)"
show_contents Local .gitignore
}

function add_local {
cd "$(git root)"
add_patterns .gitignore "$@"
}

Expand Down

0 comments on commit e7990ed

Please sign in to comment.