Skip to content

Commit

Permalink
Merge pull request #481 from al-the-x/multi-file-touch
Browse files Browse the repository at this point in the history
Make `git-touch` behave like `touch` when passed multiple files.
  • Loading branch information
qw3rtman committed Dec 29, 2015
2 parents 176ebf9 + 2b042bd commit 1ff64e2
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions bin/git-touch
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
#!/usr/bin/env bash

filename="$*"
USAGE(){
echo "git touch <filename> [ <filename> . . .]" 1>&2
exit 1
}

test -z "$filename" && echo "filename required" 1>&2 && exit 1
test $# -lt 1 && USAGE

touch "$filename" \
&& git add "$filename"
for filename in $@; do
touch "$filename" \
&& git add "$filename"
done

0 comments on commit 1ff64e2

Please sign in to comment.