From 10f93893197f13d3351761179f860361ea95d853 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Thu, 21 Mar 2024 18:46:06 +0100 Subject: [PATCH] feat: improve gi script --- modules/profiles/base.nix | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/modules/profiles/base.nix b/modules/profiles/base.nix index ad8cbe4..41279d7 100644 --- a/modules/profiles/base.nix +++ b/modules/profiles/base.nix @@ -44,7 +44,7 @@ let gi = pkgs.writeFishApplication { name = "gi"; - runtimeInputs = with pkgs; [ fzf gum curl ]; + runtimeInputs = with pkgs; [ fzf gum curl coreutils-full ]; text = /* fish */ '' set url https://www.gitignore.io/api @@ -57,10 +57,12 @@ let set choice (string join "," $argv[1..]) end + set contents "$(curl -sL $url/$choice | head -n -2 | tail -n +4)" + if gum confirm "Overwrite current .gitignore?" - curl -sL $url/$choice > .gitignore + echo "$contents" > .gitignore else - curl -sL $url/$choice >> .gitignore + echo "$contents" >> .gitignore end ''; completions = /* fish */ ''