Skip to content

Commit

Permalink
Merge pull request #46 from sentry-demos/armcknight/fix/upload-script…
Browse files Browse the repository at this point in the history
…-fix-auth-token

fix: auth token retrieval from .sentryclirc
  • Loading branch information
kpujjigit authored Sep 27, 2023
2 parents 1027c44 + d1a9a92 commit 0c2bc65
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions upload-symbols.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@ if which sentry-cli >/dev/null; then
echo "[ERROR] .env does not exist or does not have SENTRY_ORG and SENTRY_PROJECT defined"
exit 1
fi
if [ ! -n "$SENTRY_AUTH_TOKEN" ]; then
if [ -z "$SENTRY_AUTH_TOKEN" ]; then
if [ -f ~/.sentryclirc ]; then
export SENTRY_AUTH_TOKEN=$(grep -oE "token=([^\n\r]*)$" ~/.sentryclirc | cut -d'=' -f2)
export SENTRY_AUTH_TOKEN=$(grep -oE "token=(.*)$" ~/.sentryclirc | cut -d'=' -f2)
echo "Using SENTRY_AUTH_TOKEN from .sentryclirc."
fi
if [ -f ~/.zshrc ] && grep -q "export SENTRY_AUTH_TOKEN" ~/.zshrc; then
grep -m 1 "export SENTRY_AUTH_TOKEN" ~/.zshrc > /tmp/ios.sentry-build.tmp && source /tmp/ios.sentry-build.tmp && rm /tmp/ios.sentry-build.tmp
echo "Using SENTRY_AUTH_TOKEN from .zshrc."
fi
fi
if [ ! -n "$SENTRY_AUTH_TOKEN" ]; then
if [ -z "$SENTRY_AUTH_TOKEN" ]; then
echo "[ERROR] must provide SENTRY_AUTH_TOKEN either through command line, .zshrc or .sentryclirc"
exit 1
fi
Expand Down

0 comments on commit 0c2bc65

Please sign in to comment.