aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/git/.local
diff options
context:
space:
mode:
Diffstat (limited to 'git/.local')
-rw-r--r--git/.local/bin/git-ignore20
1 files changed, 20 insertions, 0 deletions
diff --git a/git/.local/bin/git-ignore b/git/.local/bin/git-ignore
new file mode 100644
index 0000000..7df638d
--- /dev/null
+++ b/git/.local/bin/git-ignore
@@ -0,0 +1,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