feat: improve gi script
This commit is contained in:
parent
09caae2e4e
commit
10f9389319
1 changed files with 5 additions and 3 deletions
|
@ -44,7 +44,7 @@ let
|
||||||
|
|
||||||
gi = pkgs.writeFishApplication {
|
gi = pkgs.writeFishApplication {
|
||||||
name = "gi";
|
name = "gi";
|
||||||
runtimeInputs = with pkgs; [ fzf gum curl ];
|
runtimeInputs = with pkgs; [ fzf gum curl coreutils-full ];
|
||||||
text = /* fish */ ''
|
text = /* fish */ ''
|
||||||
set url https://www.gitignore.io/api
|
set url https://www.gitignore.io/api
|
||||||
|
|
||||||
|
@ -57,10 +57,12 @@ let
|
||||||
set choice (string join "," $argv[1..])
|
set choice (string join "," $argv[1..])
|
||||||
end
|
end
|
||||||
|
|
||||||
|
set contents "$(curl -sL $url/$choice | head -n -2 | tail -n +4)"
|
||||||
|
|
||||||
if gum confirm "Overwrite current .gitignore?"
|
if gum confirm "Overwrite current .gitignore?"
|
||||||
curl -sL $url/$choice > .gitignore
|
echo "$contents" > .gitignore
|
||||||
else
|
else
|
||||||
curl -sL $url/$choice >> .gitignore
|
echo "$contents" >> .gitignore
|
||||||
end
|
end
|
||||||
'';
|
'';
|
||||||
completions = /* fish */ ''
|
completions = /* fish */ ''
|
||||||
|
|
Loading…
Reference in a new issue