From 20246a31f3ab1871c8650640e7dc6529e0d2ef7b Mon Sep 17 00:00:00 2001 From: Stephanie Closson Date: Tue, 7 Apr 2020 09:29:31 -0600 Subject: [PATCH] Fix for deprecating packages (#23403) * Fix for deprecating packages * fixed tabs * code review - added set -eo pipefail --- scripts/circle-release-next-packages.sh | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/scripts/circle-release-next-packages.sh b/scripts/circle-release-next-packages.sh index 78504358075..606f4b6a917 100755 --- a/scripts/circle-release-next-packages.sh +++ b/scripts/circle-release-next-packages.sh @@ -1,4 +1,5 @@ #!/usr/bin/env bash +set -eo pipefail PACKAGES=(ui toolkit data runtime e2e) @@ -28,13 +29,9 @@ function unpublish_previous_canary () { echo "Unpublish @grafana/${PACKAGE}@${CURRENT_CANARY}" npm unpublish "@grafana/${PACKAGE}@${CURRENT_CANARY}" || ( # We want to deprecate here, rather than fail and return an non-0 exit code - npm deprecate \ - "@grafana/${PACKAGE}@${CURRENT_CANARY}" \ - "Unpublish failed with [$?]. Deprecating \"@grafana/${PACKAGE}@${CURRENT_CANARY}\"" || ( - # Echoing a log message will ultimately change the error code, so save the error - # code and return it after printing an error log. - echo "Could not deprecate \"@grafana/${PACKAGE}@${CURRENT_CANARY}\". Received exit-code [$?]" - ) + echo "Unpublish unsucessful [$?]. Deprecating @grafana/${PACKAGE}@${CURRENT_CANARY}" + # But if this fails, return the error code + npm deprecate "@grafana/${PACKAGE}@${CURRENT_CANARY}" ) fi done