From f830666940c3bee5c73510636d381c6aef66212b Mon Sep 17 00:00:00 2001 From: Marc-Antoine Date: Thu, 18 Jun 2020 17:19:21 +0200 Subject: [PATCH 1/4] Allow to force Yarn usage --- run-build-functions.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/run-build-functions.sh b/run-build-functions.sh index b68f899e..e3f2a4bf 100755 --- a/run-build-functions.sh +++ b/run-build-functions.sh @@ -458,7 +458,7 @@ install_dependencies() { if [ -f package.json ] then restore_cwd_cache node_modules "node modules" - if [ -f yarn.lock ] + if [ -f yarn.lock ] || [ ! -z $USE_YARN ] then run_yarn $YARN_VERSION else @@ -471,7 +471,7 @@ install_dependencies() { then if ! [ $(which bower) ] then - if [ -f yarn.lock ] + if [ -f yarn.lock ] || [ ! -z $USE_YARN ] then echo "Installing bower with Yarn" yarn add bower From 152040114eee1bedef62aef295ec48c997207e75 Mon Sep 17 00:00:00 2001 From: Marc-Antoine Fernandes Date: Fri, 19 Jun 2020 10:43:10 +0200 Subject: [PATCH 2/4] Don't use yarn if USE_YARN is false and only force install yarn if true --- run-build-functions.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/run-build-functions.sh b/run-build-functions.sh index e3f2a4bf..4a4b99da 100755 --- a/run-build-functions.sh +++ b/run-build-functions.sh @@ -458,7 +458,7 @@ install_dependencies() { if [ -f package.json ] then restore_cwd_cache node_modules "node modules" - if [ -f yarn.lock ] || [ ! -z $USE_YARN ] + if ([ -f yarn.lock ] && [ ! "$USE_YARN" = "false" ]) || [ "$USE_YARN" = "true" ] then run_yarn $YARN_VERSION else @@ -471,7 +471,7 @@ install_dependencies() { then if ! [ $(which bower) ] then - if [ -f yarn.lock ] || [ ! -z $USE_YARN ] + if ([ -f yarn.lock ] && [ ! "$USE_YARN" = "false" ]) || [ "$USE_YARN" = "true" ] then echo "Installing bower with Yarn" yarn add bower From c1353e502ebe19e94623a7a67dadaf92a17d533f Mon Sep 17 00:00:00 2001 From: Marc-Antoine Date: Fri, 19 Jun 2020 14:36:29 +0200 Subject: [PATCH 3/4] Short-circuit yarn check when env var is set Co-authored-by: ehmicky --- run-build-functions.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/run-build-functions.sh b/run-build-functions.sh index 4a4b99da..34064a48 100755 --- a/run-build-functions.sh +++ b/run-build-functions.sh @@ -458,7 +458,7 @@ install_dependencies() { if [ -f package.json ] then restore_cwd_cache node_modules "node modules" - if ([ -f yarn.lock ] && [ ! "$USE_YARN" = "false" ]) || [ "$USE_YARN" = "true" ] + if [ "$USE_YARN" = "true" ] || ([ "$USE_YARN" != "false" ] && [ -f yarn.lock ]) then run_yarn $YARN_VERSION else @@ -471,7 +471,7 @@ install_dependencies() { then if ! [ $(which bower) ] then - if ([ -f yarn.lock ] && [ ! "$USE_YARN" = "false" ]) || [ "$USE_YARN" = "true" ] + if [ "$USE_YARN" = "true" ] || ([ "$USE_YARN" != "false" ] && [ -f yarn.lock ]) then echo "Installing bower with Yarn" yarn add bower From d0922ebbbd0b43a2be34ba672b7aaba047820803 Mon Sep 17 00:00:00 2001 From: Marc-Antoine Date: Thu, 2 Jul 2020 16:32:19 +0200 Subject: [PATCH 4/4] Prefix env var with NETLIFY_ Co-authored-by: ehmicky --- run-build-functions.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/run-build-functions.sh b/run-build-functions.sh index 34064a48..b9982dfc 100755 --- a/run-build-functions.sh +++ b/run-build-functions.sh @@ -458,7 +458,7 @@ install_dependencies() { if [ -f package.json ] then restore_cwd_cache node_modules "node modules" - if [ "$USE_YARN" = "true" ] || ([ "$USE_YARN" != "false" ] && [ -f yarn.lock ]) + if [ "$NETLIFY_USE_YARN" = "true" ] || ([ "$NETLIFY_USE_YARN" != "false" ] && [ -f yarn.lock ]) then run_yarn $YARN_VERSION else @@ -471,7 +471,7 @@ install_dependencies() { then if ! [ $(which bower) ] then - if [ "$USE_YARN" = "true" ] || ([ "$USE_YARN" != "false" ] && [ -f yarn.lock ]) + if [ "$NETLIFY_USE_YARN" = "true" ] || ([ "$NETLIFY_USE_YARN" != "false" ] && [ -f yarn.lock ]) then echo "Installing bower with Yarn" yarn add bower