From 1d8f252a51ab7119bbaa5ea4ee22bf03a6c603d7 Mon Sep 17 00:00:00 2001 From: David Boreham Date: Tue, 23 May 2023 03:42:55 +0800 Subject: [PATCH] Detect bad reponse from yarn info (#406) --- .../cerc-builder-js/yarn-local-registry-fixup.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/data/container-build/cerc-builder-js/yarn-local-registry-fixup.sh b/app/data/container-build/cerc-builder-js/yarn-local-registry-fixup.sh index ad11ce80..95e19194 100755 --- a/app/data/container-build/cerc-builder-js/yarn-local-registry-fixup.sh +++ b/app/data/container-build/cerc-builder-js/yarn-local-registry-fixup.sh @@ -27,8 +27,8 @@ yarn_info_output=$(yarn info --json $versioned_target_package 2>/dev/null) # If it doesn't exist there will be no .data.dist.tarball element, # and jq will output the string "null" package_tarball=$(echo $yarn_info_output | jq -r .data.dist.tarball) -if [[ $package_tarball == "null" ]]; then - echo "FATAL: Target package version ($versioned_target_package) not found" >&2 +if [[ "$yarn_info_output" == "" || $package_tarball == "null" ]]; then + echo "FATAL: Target package version ($versioned_target_package) not found (or bad npm auth token)" >&2 exit 1 fi # Code below parses out the values we need