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

Commit ba5928d

Browse files
authored
feat: replace EXPERIMENTAL_NPM_WORKSPACES_CACHING with a LaunchDarkly feature flag (#769)
1 parent a162bdc commit ba5928d

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

run-build-functions.sh

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,8 @@ mkdir -p $NETLIFY_CACHE_DIR/.cargo
7777
# have escaped commas in their value. Otherwise, parsing the list as an array,
7878
# e.g. using `IFS="," read -ra <<<"$1"` would be needed.
7979
has_feature_flag() {
80-
if [[ "${1}," == *"${2},"* ]]; then
80+
if [[ "${1}," == *"${2},"* ]]
81+
then
8182
return 0
8283
else
8384
return 1
@@ -183,7 +184,9 @@ run_npm_set_temp() {
183184
}
184185

185186
run_npm() {
186-
if [ -n "$EXPERIMENTAL_NPM_WORKSPACES_CACHING" ]
187+
local featureFlags="$1"
188+
189+
if [ -n "$EXPERIMENTAL_NPM_WORKSPACES_CACHING" ] || has_feature_flag "$featureFlags" "build_image_npm_workspaces_caching"
187190
then
188191
restore_node_modules "npm"
189192
else
@@ -542,7 +545,7 @@ install_dependencies() {
542545
then
543546
run_yarn $YARN_VERSION
544547
else
545-
run_npm
548+
run_npm "$featureFlags"
546549
fi
547550
fi
548551

0 commit comments

Comments
 (0)