aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/git/.local/bin/git-ignore
blob: 7df638d46a85dea9764fa26f4bed32d68ad34fa9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/bin/sh

# Create useful gitignore files
# Usage: gi [param]
# param is a comma separated list of ignore profiles.
# If param is ommited choose interactively.

__gi() {
	curl -L -s https://www.gitignore.io/api/"$*"
}

if [ "$#" -eq 0 ]; then
	IFS=$IFS+","
	for item in $(__gi list); do
		echo "$item"
	done | fzf --multi --ansi | paste -s -d "," - |
		{ read -r result && __gi "$result"; }
else
	__gi "$@"
fi