Unverified Commit 30992a8c authored by Sandro Jäckel's avatar Sandro Jäckel
Browse files

buildNpmPackage: give a hint when npm prune fails



Co-authored-by: default avatarLily Foster <lily@lily.flowers>
parent 0ed41137
Loading
Loading
Loading
Loading
+10 −1
Original line number Diff line number Diff line
@@ -34,7 +34,16 @@ npmInstallHook() {

    if [ ! -d "$nodeModulesPath" ]; then
        if [ -z "${dontNpmPrune-}" ]; then
            npm prune --omit=dev --no-save ${npmWorkspace+--workspace=$npmWorkspace} $npmPruneFlags "${npmPruneFlagsArray[@]}" $npmFlags "${npmFlagsArray[@]}"
            if ! npm prune --omit=dev --no-save ${npmWorkspace+--workspace=$npmWorkspace} $npmPruneFlags "${npmPruneFlagsArray[@]}" $npmFlags "${npmFlagsArray[@]}"; then
              echo
              echo
              echo "ERROR: npm prune step failed"
              echo
              echo 'If npm tried to download additional dependencies above, try setting `dontNpmPrune = true`.'
              echo

              exit 1
            fi
        fi

        find node_modules -maxdepth 1 -type d -empty -delete