From 65adb4cceb944a45a17b0c02739e757eeca459b6 Mon Sep 17 00:00:00 2001 From: Lap Tran Date: Wed, 30 Sep 2026 20:12:45 -0400 Subject: [PATCH] no-mistakes(test): Fix no-mistakes agent:auto to [pi] migration using sed --- home.nix | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/home.nix b/home.nix index 81b9674..3968a1f 100644 --- a/home.nix +++ b/home.nix @@ -312,16 +312,9 @@ in fi # Ensure global config uses Pi (idempotent - only writes if missing or still `agent: auto`) cfg="$HOME/.no-mistakes/config.yaml" - if [ -f "$cfg" ] && grep -qE '^\s*agent:\s*auto\s*$' "$cfg"; then + if [ -f "$cfg" ] && grep -qE '^[[:space:]]*agent:[[:space:]]*auto[[:space:]]*$' "$cfg"; then tmp="$(mktemp)" - awk ' - /^\s*agent:\s*auto\s*$/ { - print "# Managed by dotfiles/home.nix home.activation.noMistakes"; - print "agent: [pi]"; - next - } - { print } - ' "$cfg" > "$tmp" && mv "$tmp" "$cfg" + sed 's|^[[:space:]]*agent:[[:space:]]*auto[[:space:]]*$|# Managed by dotfiles/home.nix home.activation.noMistakes\nagent: [pi]|' "$cfg" > "$tmp" && mv "$tmp" "$cfg" fi if [ ! -f "$cfg" ]; then mkdir -p "$(dirname "$cfg")"