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

Commit

Permalink
fix: indentation issues in bash script (#872)
Browse files Browse the repository at this point in the history
* fix: indentation issues in bash script

* chore: updates
  • Loading branch information
lukasholzer authored Nov 17, 2022
1 parent e0cd187 commit 6c32ec3
Showing 1 changed file with 20 additions and 24 deletions.
44 changes: 20 additions & 24 deletions run-build-functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ install_deps() {
restore_node_modules() {
local installer=$1

if has_feature_flag "$featureFlags" "build-image_use_new_package_manager_detection"; then
if has_feature_flag "$featureFlags" "build-image_use_new_package_manager_detection"; then
local workspaces=($(echo "$buildInfo" | jq -r '.jsWorkspaces | join(" ")'))

if [ "$workspaces" ]; then
Expand Down Expand Up @@ -143,7 +143,7 @@ restore_node_modules() {
echo "No $installer workspaces detected"
restore_cwd_cache node_modules "node modules"
fi
fi # end feature flag if
fi # end feature flag if
}

run_yarn() {
Expand Down Expand Up @@ -618,30 +618,28 @@ install_dependencies() {
: ${CYPRESS_CACHE_FOLDER="./node_modules/.cache/CypressBinary"}
export CYPRESS_CACHE_FOLDER

if [ -f package.json ]
then
if [ -f package.json ];then
if [ "$NODE_ENV" == "production" ];then
warn "The environment variable 'NODE_ENV' is set to 'production'. Any 'devDependencies' in package.json will not be installed"
fi

restore_home_cache ".node/corepack" "corepack dependencies"

if has_feature_flag "$featureFlags" "build-image_use_new_package_manager_detection"; then
local pkgManager=$(echo "$buildInfo" | jq -r '.packageManager.name')
case $pkgManager in
"yarn")
run_yarn "$YARN_VERSION" "$featureFlags"
;;
"pnpm")
run_pnpm "$PNPM_VERSION" "$featureFlags"
;;
*)
run_npm "$featureFlags"
;;
esac

else
# feature flag turned off use the old detection
if has_feature_flag "$featureFlags" "build-image_use_new_package_manager_detection"; then
local pkgManager=$(echo "$buildInfo" | jq -r '.packageManager.name')
case $pkgManager in
"yarn")
run_yarn "$YARN_VERSION" "$featureFlags"
;;
"pnpm")
run_pnpm "$PNPM_VERSION" "$featureFlags"
;;
*)
run_npm "$featureFlags"
;;
esac
else
# feature flag turned off use the old detection
if [ "$NETLIFY_USE_YARN" = "true" ] || ([ "$NETLIFY_USE_YARN" != "false" ] && [ -f yarn.lock ]); then
run_yarn $YARN_VERSION "$featureFlags"
elif [ "$NETLIFY_USE_PNPM" = "true" ] || ([ "$NETLIFY_USE_PNPM" != "false" ] && [ -f pnpm-lock.yaml ]); then
Expand All @@ -653,8 +651,7 @@ install_dependencies() {
fi

# Bower Dependencies
if [ -f bower.json ]
then
if [ -f bower.json ];then
if ! [ $(which bower) ]
then
if [ "$NETLIFY_USE_YARN" = "true" ] || ([ "$NETLIFY_USE_YARN" != "false" ] && [ -f yarn.lock ])
Expand All @@ -679,8 +676,7 @@ install_dependencies() {
fi

# Leiningen
if [ -f project.clj ]
then
if [ -f project.clj ]; then
restore_home_cache ".m2" "maven dependencies"
if install_deps project.clj $JAVA_VERSION $NETLIFY_CACHE_DIR/project-clj-sha
then
Expand Down

0 comments on commit 6c32ec3

Please sign in to comment.