Skip to content

Commit

Permalink
Check Emacs versions
Browse files Browse the repository at this point in the history
  • Loading branch information
akirak committed Oct 15, 2023
1 parent 8c72e14 commit fed0fe3
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -67,5 +67,31 @@
emacsPackages)
);
});

checks = eachSystem (
pkgs:
lib.mapAttrs' (
name: emacsPackage:
lib.nameValuePair
"${name}-version" (pkgs.runCommand "check-${name}-version" {
buildInputs = [
emacsPackage
];
} ''
EXPECTED="GNU Emacs ${emacsPackage.version}"
ACTUAL="$(emacs --version | grep -F 'GNU Emacs' | head -1)"
if [[ "$EXPECTED" = "$ACTUAL" ]]
then
echo >&2 "OK: $ACTUAL"
touch "$out"
exit 0
else
echo >&2 "NG: $EXPECTED (expected) vs. $ACTUAL (actual)"
exit 1
fi
'')
)
emacsPackages
);
};
}

0 comments on commit fed0fe3

Please sign in to comment.