mirror of
https://github.com/ipetkov/crane.git
synced 2024-11-24 00:42:39 +03:00
25 lines
536 B
Nix
25 lines
536 B
Nix
{ cleanCargoToml
|
|
, linkFarmFromDrvs
|
|
, runCommandLocal
|
|
, writeTOML
|
|
}:
|
|
|
|
let
|
|
cmpCleanCargoToml = name: path:
|
|
let
|
|
cleaned = cleanCargoToml {
|
|
cargoToml = path + /Cargo.toml;
|
|
};
|
|
cleanedToml = writeTOML "cleaned.toml" cleaned;
|
|
expected = path + /expected.toml;
|
|
in
|
|
runCommandLocal "compare-${name}" { } ''
|
|
diff ${expected} ${cleanedToml}
|
|
touch $out
|
|
'';
|
|
in
|
|
linkFarmFromDrvs "cleanCargoToml" [
|
|
(cmpCleanCargoToml "barebones" ./barebones)
|
|
(cmpCleanCargoToml "complex" ./complex)
|
|
]
|