From c9209f82d14aa0aec4fb9498e045d7dd73c16050 Mon Sep 17 00:00:00 2001 From: William Date: Wed, 15 Oct 2025 16:12:57 -0300 Subject: [PATCH] fixed hm generation cleanup --- packages/hm-cli.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/hm-cli.nix b/packages/hm-cli.nix index 715a1ad..ef3ec30 100644 --- a/packages/hm-cli.nix +++ b/packages/hm-cli.nix @@ -71,12 +71,12 @@ pkgs.writeShellScriptBin "hm" '' "$HM" switch --flake "$FLAKE_PATH" --switch-generation "$3" ;; cleanup) - CURRENT_GEN=$("$HM" generations | sed -n 's/^[[:space:]]*id \([0-9]\+\) (current).*/\1/p') + CURRENT_GEN=$("$HM" generations | sed -n 's/^.*id \([0-9]\+\) .* (current)$/\1/p') if [[ -z "$CURRENT_GEN" ]]; then echo "Error: could not determine current generation" exit 1 fi - OLD_GENS=$("$HM" generations | sed -n 's/^[[:space:]]*id \([0-9]\+\).*/\1/p' | grep -v "^$CURRENT_GEN$") + OLD_GENS=$("$HM" generations | sed -n 's/^.*id \([0-9]\+\) .*/\1/p' | grep -v "^$CURRENT_GEN$") if [[ -z "$OLD_GENS" ]]; then echo "No old generations to delete" else