Browse Source

feat(dev): Allow using sentry-cli 2.x (#34098)

Back in 8a21cbb662f1989edae4fdedb316782af07be550 we prevented users from using the newer version of sentry-cli since it did not support bash-hook.

This was added back in the latest release (see https://github.com/getsentry/sentry-cli/pull/1197).
Armen Zambrano G 2 years ago
parent
commit
b973a160dd
1 changed files with 2 additions and 11 deletions
  1. 2 11
      scripts/lib.sh

+ 2 - 11
scripts/lib.sh

@@ -30,18 +30,9 @@ configure-sentry-cli() {
     export SENTRY_CLI_NO_EXIT_TRAP=${SENTRY_CLI_NO_EXIT_TRAP-0}
     export SENTRY_CLI_NO_EXIT_TRAP=${SENTRY_CLI_NO_EXIT_TRAP-0}
     if [ -n "${SENTRY_DSN+x}" ] && [ -z "${SENTRY_DEVENV_NO_REPORT+x}" ]; then
     if [ -n "${SENTRY_DSN+x}" ] && [ -z "${SENTRY_DEVENV_NO_REPORT+x}" ]; then
         if ! require sentry-cli; then
         if ! require sentry-cli; then
-            # XXX: Temporary install version 1.74.3 until we upgrade to version 2.x
-            curl -sL https://gist.githubusercontent.com/armenzg/96481b0b653ecf807900373f5af09816/raw/caf5695e0eb6c214ec84f9fc217965aec928acc0/get-cli.sh | bash
-        fi
-        sentry_cli_major_version="$(sentry-cli --version | awk '{print $2}' | sed 's/\([0-9]*\).*/\1/')"
-        # XXX: Until we support version 2.x
-        if [ $sentry_cli_major_version -lt 2 ]; then
-            eval "$(sentry-cli bash-hook)"
-        else
-            echo "You are using the latest major release of sentry-cli."
-            echo "${yellow}Please remove it and we will install the correct version: rm $(which sentry-cli)${reset}"
-            exit 1
+            curl -sL https://sentry.io/get-cli/ | SENTRY_CLI_VERSION=2.0.4 bash
         fi
         fi
+        eval "$(sentry-cli bash-hook)"
     fi
     fi
 }
 }