Created
February 17, 2023 21:26
-
-
Save fathergoose/ad3bc0ed6019f43265ba5aeccc0b217f to your computer and use it in GitHub Desktop.
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 | |
if [ -f .gitignore ] && [ "$1" = "-a" ]; then | |
echo "File .gitignore already exists. Exiting." | |
exit 1 | |
fi | |
if [ ! -d .git ]; then | |
echo "No .git directory found. Exiting." | |
exit 1 | |
fi | |
if [ -n "$1" ]; then | |
curl -s "https://raw.githubusercontent.com/github/gitignore/main/$1.gitignore" >> .gitignore | |
exit 0 | |
fi | |
SUBSET_LANGS="Go Java Node Python QT Rails Ruby Rust Scala" | |
PS3="Choose a language: " | |
select lang in $SUBSET_LANGS; do | |
curl -s "https://raw.githubusercontent.com/github/gitignore/main/$lang.gitignore" >> .gitignore | |
break | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment