Skip to content

Commit

Permalink
feat(api): Update the bump script since CI doesn't run it (#5115)
Browse files Browse the repository at this point in the history
- this is so the script can be run on MacOS where the date function is
  slightly different
  • Loading branch information
wmak authored and adinauer committed Jun 9, 2022
1 parent 1fc0e48 commit 0f49099
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions scripts/bump-version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,8 @@ SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
cd $SCRIPT_DIR/..
SENTRY_API_SCHEMA_SHA="$(curl -sSL 'https://api.github.com/repos/getsentry/sentry-api-schema/commits/main' | awk 'BEGIN { RS=",|:{\n"; FS="\""; } $2 == "sha" { print $4 }')"

sed -i -e "s/\(Change Date:\s*\)[-0-9]\+\$/\\1$(date +'%Y-%m-%d' -d '3 years')/" LICENSE
sed -i -e 's|^const SENTRY_API_SCHEMA_SHA =.*$|const SENTRY_API_SCHEMA_SHA = "'$SENTRY_API_SCHEMA_SHA'"|g' src/gatsby/utils/resolveOpenAPI.ts
# These commands won't work on our machines since they're running macosx
if [ "${1:-prod}" == "prod" ]; then
sed -i -e "s/\(Change Date:\s*\)[-0-9]\+\$/\\1$(date +'%Y-%m-%d' -d '3 years')/" LICENSE
sed -i -e 's|^const SENTRY_API_SCHEMA_SHA =.*$|const SENTRY_API_SCHEMA_SHA = "'$SENTRY_API_SCHEMA_SHA'"|g' src/gatsby/utils/resolveOpenAPI.ts
fi

0 comments on commit 0f49099

Please sign in to comment.