Skip to content
This repository was archived by the owner on Jan 25, 2023. It is now read-only.

fix(npm): allow multiple NPM_FLAGS during new install execution #900

Merged
merged 1 commit into from
Jan 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion run-build-functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ run_npm() {
then
echo "Bypassing sha validation. Running pre & post install scripts"
echo "Installing npm packages using npm version $(npm --version)"
if npm install ${NPM_FLAGS:+"$NPM_FLAGS"}
if npm install ${NPM_FLAGS:+$NPM_FLAGS}
then
echo "npm packages installed"
else
Expand Down
8 changes: 7 additions & 1 deletion tests/node/bypass_cache.bats
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ load '../../node_modules/bats-assert/load'
load '../../node_modules/bats-file/load'

setup() {

NETLIFY_CACHE_DIR="/opt/buildhome/cache"
TMP_DIR=$(setup_tmp_dir)
NODE_VERSION=14
Expand All @@ -31,3 +31,9 @@ teardown() {
run run_npm "buildbot_other_flags"
assert_output --partial "Creating package sha"
}

@test 'bypass_cache can handle multiple NPM_FLAGS' {
NPM_FLAGS="--no-audit --legacy-peer-deps"
run run_npm "buildbot_other_flags"
refute_output --partial "audit"
}