Created
September 25, 2024 11:03
-
-
Save jsumners/e16a00cf27290c3bf0c6b8466a7bfa6c to your computer and use it in GitHub Desktop.
Simple Bash script to fetch GitHub maintained gitignore files
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
#!/usr/bin/env bash | |
TYPE=$1 | |
if [ "${TYPE}" == "" ]; then | |
echo "Missing gitignore type name." | |
echo "See https://github.com/github/gitignore for available types." | |
echo "Example: git fetch-ignore Objective-C" | |
exit 1 | |
fi | |
UPPER1=$(echo ${TYPE:0:1} | tr '[:lower:]' '[:upper:]') | |
TYPE="${UPPER1}${TYPE:1}" | |
curl -s https://raw.githubusercontent.com/github/gitignore/main/${TYPE}.gitignore >> .gitignore |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment