-
-
Save git2samus/5961107 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
USAGE="list | <types> ..." | |
LONG_USAGE="Generate/Append the repo's .gitignore file using the gitignore.io api | |
`curl -s http://gitignore.io/api/`" | |
SUBDIRECTORY_OK= | |
OPTIONS_SPEC= | |
. "$(git --exec-path)/git-sh-setup" | |
require_work_tree_exists | |
cd_to_toplevel | |
total=$# | |
if [ $total -eq 0 ]; then | |
usage | |
fi | |
for item in $@; do | |
if [ $item == 'list' ]; then | |
continue; | |
fi | |
done | |
LIST=$1 | |
for (( i = 2; i <= $#; i++ )); do | |
eval "LIST=$LIST,\${${i}}" | |
done | |
GITIGNORE="`curl -s http://gitignore.io/api/$LIST`" | |
echo "$GITIGNORE" | |
echo "$GITIGNORE" >> .gitignore | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment