npmHooks.npmConfigHook: add npmRoot option

This commit is contained in:
Winter 2023-05-21 17:26:22 -04:00 committed by Lily Foster
parent ac925d2c7a
commit 9117f01272
No known key found for this signature in database
GPG key ID: 49340081E484C893

View file

@ -7,6 +7,10 @@ npmConfigHook() {
export NIX_NODEJS_BUILDNPMPACKAGE=1
export prefetchNpmDeps="@prefetchNpmDeps@"
if [ -n "${npmRoot-}" ]; then
pushd "$npmRoot"
fi
echo "Configuring npm"
export HOME="$TMPDIR"
@ -105,6 +109,10 @@ npmConfigHook() {
rm "$CACHE_MAP_PATH"
unset CACHE_MAP_PATH
if [ -n "${npmRoot-}" ]; then
popd
fi
echo "Finished npmConfigHook"
}