mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-22 23:13:19 +00:00
npmHooks.npmInstallHook: allow disabling npm prune
invocation
In some odd scenarios, `npm prune` either fails, or hangs. I have no idea what could possibly be wrong at the moment, but let's provide an escape hatch for packages that can still use the rest of the install hook's functionality.
This commit is contained in:
parent
91b4efa44d
commit
f9138c5ad6
@ -27,7 +27,10 @@ npmInstallHook() {
|
||||
local -r nodeModulesPath="$packageOut/node_modules"
|
||||
|
||||
if [ ! -d "$nodeModulesPath" ]; then
|
||||
npm prune --omit dev --no-save $npmInstallFlags "${npmInstallFlagsArray[@]}" $npmFlags "${npmFlagsArray[@]}"
|
||||
if [ -z "${dontNpmPrune-}" ]; then
|
||||
npm prune --omit dev --no-save $npmInstallFlags "${npmInstallFlagsArray[@]}" $npmFlags "${npmFlagsArray[@]}"
|
||||
fi
|
||||
|
||||
find node_modules -maxdepth 1 -type d -empty -delete
|
||||
|
||||
cp -r node_modules "$nodeModulesPath"
|
||||
|
Loading…
Reference in New Issue
Block a user