✨ feat(bin): add a new script to create gitignore files
This commit is contained in:
parent
9e8b385b1d
commit
c9761ef164
1 changed files with 20 additions and 0 deletions
20
.local/bin/ignore
Executable file
20
.local/bin/ignore
Executable file
|
@ -0,0 +1,20 @@
|
|||
#!/bin/sh
|
||||
|
||||
function __gi() {
|
||||
curl -L -s https://www.gitignore.io/api/"$@"
|
||||
}
|
||||
|
||||
if [ "$#" -eq 0 ]; then
|
||||
IFS+=","
|
||||
result=$(for item in $(__gi list); do
|
||||
echo $item
|
||||
done | fzf --multi --ansi | paste -s -d "," -)
|
||||
|
||||
if [ -n "$result" ]; then
|
||||
__gi "$result" > .gitignore
|
||||
echo ".gitignore created: $result"
|
||||
fi
|
||||
else
|
||||
__gi "$@" > .gitignore
|
||||
echo ".gitignore created: $@"
|
||||
fi
|
Loading…
Add table
Reference in a new issue