✨ prettify gi script
This commit is contained in:
parent
3e41191313
commit
a561219742
1 changed files with 14 additions and 6 deletions
|
@ -57,15 +57,23 @@ in
|
||||||
${exportedVariables}
|
${exportedVariables}
|
||||||
'';
|
'';
|
||||||
functions = {
|
functions = {
|
||||||
gi = ''
|
gi = with pkgs; ''
|
||||||
set url https://www.gitignore.io/api
|
set url https://www.gitignore.io/api
|
||||||
if test (count $argv) -ne 1
|
|
||||||
set list (curl -sL $url/list | string split ",")
|
if test (count $argv) -eq 0
|
||||||
set choice (string split " " $list | fzf -m --preview "curl -sL $url/{}" | string join ",")
|
set choice ( curl -sL $url/list \
|
||||||
|
| string split "," \
|
||||||
|
| ${fzf}/bin/fzf -m \
|
||||||
|
| string join "," )
|
||||||
else
|
else
|
||||||
set choice $argv[1]
|
set choice (string join "," $argv[1..])
|
||||||
|
end
|
||||||
|
|
||||||
|
if ${gum}/bin/gum confirm "Overwrite current .gitignore?"
|
||||||
|
${curl}/bin/curl -sL $url/$choice > .gitignore
|
||||||
|
else
|
||||||
|
${curl}/bin/curl -sL $url/$choice >> .gitignore
|
||||||
end
|
end
|
||||||
curl -sL $url/$choice > .gitignore
|
|
||||||
'';
|
'';
|
||||||
fish_greeting = "";
|
fish_greeting = "";
|
||||||
cheat = "cht.sh $argv | bat -p";
|
cheat = "cht.sh $argv | bat -p";
|
||||||
|
|
Loading…
Reference in a new issue