Last active
May 18, 2022 17:30
-
-
Save pwc3/839f88c32b7bdbd0e86b78d6d784e8bd to your computer and use it in GitHub Desktop.
Downloads Github's recommended .gitignore for the specified language and prints it to stdout
This file contains 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
#!/usr/bin/env bash | |
# Downloads Github's recommended .gitignore for the specified language and prints it to stdout. | |
# | |
# When starting a project: | |
# gh-gitignore Swift > .gitignore | |
set -euo pipefail | |
E_BADARGS=85 | |
if [ $# -ne 1 ]; then | |
echo "Usage: $(basename $0) language" >&2 | |
echo "Downloads Github's recommended .gitignore for the specified language" >&2 | |
exit $E_BADARGS | |
fi | |
language="$1" | |
curl https://raw.githubusercontent.com/github/gitignore/main/${language}.gitignore | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment