Skip to content

Instantly share code, notes, and snippets.

@MaddyGuthridge
Last active March 27, 2023 13:32
Show Gist options
  • Save MaddyGuthridge/aa97dc5d21ee426fc2689a72bfdc018d to your computer and use it in GitHub Desktop.
Save MaddyGuthridge/aa97dc5d21ee426fc2689a72bfdc018d to your computer and use it in GitHub Desktop.
Gitignore grabber
# 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