-
-
Save phha/cb4f4bb07519dc494609792fb918e167 to your computer and use it in GitHub Desktop.
Interactively greate a gitignore file from gitignore.io
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
#!/bin/sh | |
# Create useful gitignore files | |
# Usage: gi [param] | |
# param is a comma separated list of ignore profiles. | |
# If param is ommited choose interactively. | |
function __gi() { | |
curl -L -s https://www.gitignore.io/api/"$@" | |
} | |
if [ "$#" -eq 0 ]; then | |
IFS+="," | |
for item in $(__gi list); do | |
echo $item | |
done | fzf --multi --ansi | paste -s -d "," - | | |
{ read result && __gi "$result"; } | |
else | |
__gi "$@" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment