Last active
March 27, 2023 13:32
-
-
Save MaddyGuthridge/aa97dc5d21ee426fc2689a72bfdc018d to your computer and use it in GitHub Desktop.
Gitignore grabber
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
# Simple function to grab a .gitignore file from GitHub | |
# Usage: gitignore [language name] | |
# Note that it's case-sensitive. This it GitHub's fault, not mine | |
gitignore () | |
{ | |
curl -s --fail "https://raw.githubusercontent.com/github/gitignore/main/$1.gitignore" -o .gitignore | |
if [ $? -eq 0 ]; then | |
return 0 | |
else | |
echo "Lookup failed, maybe check capitalisation?" | |
return 1 | |
fi | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment