Last active
March 13, 2019 21:54
-
-
Save elboletaire/8492492 to your computer and use it in GitHub Desktop.
A bash method to get gitignore files from github gitignore's repo
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
get_gitignore() { | |
local gitignore=https://raw.github.com/github/gitignore/master/$1.gitignore | |
local exists=`curl -s --head -w %{http_code} $gitignore -o /dev/null` | |
if [[ $exists -eq 404 ]]; then | |
echo "El gitignore esmentat no existeix. Comprova que l'has escrit be" | |
else | |
curl -s https://raw.githubusercontent.com/github/gitignore/master/$1.gitignore | |
fi | |
} | |
alias get-gitignore="get_gitignore" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment