✨ feat(git): added script for easy gitignore creation
This commit is contained in:
parent
eea1e69238
commit
c47fb9bd14
2 changed files with 15 additions and 1 deletions
|
@ -233,4 +233,5 @@
|
|||
ours = "!f() { git checkout --ours $@ && git add $@; }; f"
|
||||
theirs = "!f() { git checkout --theirs $@ && git add $@; }; f"
|
||||
subrepo = !sh -c 'git filter-branch --prune-empty --subdirectory-filter $1 master' -
|
||||
human = name-rev --name-only --refs=refs/heads/*
|
||||
human = name-rev --name-only --refs=refs/heads/*
|
||||
ig = "!f() { gitignore \"$@\"; }; f"
|
||||
|
|
13
.local/bin/gitignore
Executable file
13
.local/bin/gitignore
Executable file
|
@ -0,0 +1,13 @@
|
|||
#!/bin/bash
|
||||
|
||||
function __gi() {
|
||||
curl -L -s https://www.gitignore.io/api/"$@"
|
||||
}
|
||||
|
||||
|
||||
IFS=","
|
||||
selected_profiles=$(for item in $(__gi list); do echo $item; done | fzf --multi --ansi | paste -s -d "," -)
|
||||
if [ -n "$selected_profiles" ]; then
|
||||
echo "$selected_profiles" | { read result && __gi "$result" > .gitignore; echo "Created .gitignore"; }
|
||||
fi
|
||||
|
Loading…
Add table
Reference in a new issue