From 2192cb51483683fa82be8c56a4513db076ef26e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?m=C3=BCde?= Date: Sun, 17 May 2026 01:22:31 +0200 Subject: [PATCH] forge-login: don't die on RO ~/.config/git/config MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit home-manager / nix-managed git configs ship the file from the nix store, so `git config --global` errors out. catch the failure and print the equivalent home-manager snippet instead of aborting — the tea + netrc steps still want to run. --- scripts/forge-login.sh | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/scripts/forge-login.sh b/scripts/forge-login.sh index c0e669d..9c60303 100755 --- a/scripts/forge-login.sh +++ b/scripts/forge-login.sh @@ -40,9 +40,21 @@ if [ -z "$token" ]; then exit 1 fi -git config --global user.name "$username" -git config --global user.email "$email" -echo "git config: $username <$email>" +if git config --global user.name "$username" 2>/dev/null \ + && git config --global user.email "$email" 2>/dev/null; then + echo "git config: $username <$email>" +else + cat <