pnpm.fetchDeps: error if lockfile version has a mismatch
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
{
|
||||
lib,
|
||||
stdenvNoCC,
|
||||
callPackage,
|
||||
jq,
|
||||
@@ -6,6 +7,7 @@
|
||||
cacert,
|
||||
makeSetupHook,
|
||||
pnpm,
|
||||
yq,
|
||||
}:
|
||||
{
|
||||
fetchDeps =
|
||||
@@ -38,11 +40,18 @@
|
||||
jq
|
||||
moreutils
|
||||
pnpm
|
||||
yq
|
||||
];
|
||||
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
|
||||
lockfileVersion="$(yq -r .lockfileVersion pnpm-lock.yaml)"
|
||||
if [[ ''${lockfileVersion:0:1} -gt ${lib.versions.major pnpm.version} ]]; then
|
||||
echo "ERROR: lockfileVersion $lockfileVersion in pnpm-lock.yaml is too new for the provided pnpm version ${lib.versions.major pnpm.version}!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
export HOME=$(mktemp -d)
|
||||
pnpm config set store-dir $out
|
||||
# Some packages produce platform dependent outputs. We do not want to cache those in the global store
|
||||
|
||||
Reference in New Issue
Block a user