mirror of
https://github.com/tj/git-extras.git
synced 2026-09-10 15:36:21 -04:00
Merge pull request #481 from al-the-x/multi-file-touch
Make `git-touch` behave like `touch` when passed multiple files.
This commit is contained in:
commit
1ff64e2fed
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue