fix(packages/rebuild): fix generation check logic

This commit is contained in:
Mohammad Rafiq 2025-06-13 06:14:43 +08:00
parent 42b3a92d9b
commit 66bc9f679d
No known key found for this signature in database

View file

@ -91,14 +91,13 @@ pkgs.writeShellScriptBin "rebuild" # sh
nh os switch . || { nh os switch . || {
exit 1 exit 1
} }
fi if ! "$NO_GENERATION_CHECK"; then
NEW_GENERATION=$(readlink /nix/var/nix/profiles/system | cut -d- -f2)
if ! "$NO_GENERATION_CHECK"; then echo "New generation is $NEW_GENERATION. Current is $CURRENT_GENERATION."
NEW_GENERATION=$(readlink /nix/var/nix/profiles/system | cut -d- -f2) if [ ! $NEW_GENERATION -gt $CURRENT_GENERATION ]; then
echo "New generation is $NEW_GENERATION. Current is $CURRENT_GENERATION." echo "ERROR: New config was not added to bootloader. Exiting..."
if [ ! $NEW_GENERATION -gt $CURRENT_GENERATION ]; then exit 1
echo "ERROR: New config was not added to bootloader. Exiting..." fi
exit 1
fi fi
fi fi