]> git.scottworley.com Git - nix-profile-gc/commitdiff
profile-gc: No unbound variable references
authorScott Worley <scottworley@scottworley.com>
Thu, 17 Nov 2022 14:03:04 +0000 (06:03 -0800)
committerScott Worley <scottworley@scottworley.com>
Thu, 17 Nov 2022 14:03:04 +0000 (06:03 -0800)
modules/profile-gc.nix

index 8e693010f647c09d4849f16f515c7ba2b9e6b300..02b723829fba668014722f18faa633a647781d70 100644 (file)
@@ -161,11 +161,11 @@ in {
             echo "Keeeping current profile $p" >&2
             continue
           fi
-          if [[ "''${active_targets[$(${pkgs.coreutils}/bin/readlink "$p")]}" ]];then
+          if [[ "''${active_targets[$(${pkgs.coreutils}/bin/readlink "$p")]:-}" ]];then
             echo "Keeeping active system/boot profile $p" >&2
             continue
           fi
-          if [[ "''${active[$p]}" ]];then
+          if [[ "''${active[$p]:-}" ]];then
             echo "Keeeping active profile $p" >&2
             continue
           fi