mirror of
https://github.com/sdkman/sdkman-cli.git
synced 2026-01-16 02:17:44 -05:00
Standardize the formatting of .sh files using auto-formatting specified in .editorconfig, plus some manual reformatting that conforms to .editorconfig: - Fix improper indents - Use 4-character-wide tabs for indents - Append () to function names in function declarations - Only one empty line at end of file - Add or remove empty lines - Insert initial spaces in comments - Removed unnecessary semicolons - Spread conditionals over multiple lines - Other minor spacing & format cleanup
24 lines
544 B
Bash
Executable File
24 lines
544 B
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
BRANCH="$1"
|
|
BUILD_NUMBER="$2"
|
|
MONGO_URL="$3"
|
|
MONGO_USERNAME="$4"
|
|
MONGO_PASSWORD="$5"
|
|
VERSION="$BRANCH+$BUILD_NUMBER"
|
|
|
|
if [[ -z "$MONGO_USERNAME" || -z "$MONGO_PASSWORD" ]]; then
|
|
echo "No mongo credentials so doing nothing..."
|
|
return 0
|
|
fi
|
|
|
|
if [[ "$BRANCH" == 'master' ]]; then
|
|
FIELD="betaCliVersion"
|
|
else
|
|
FIELD="stableCliVersion"
|
|
fi
|
|
|
|
echo "Release: $FIELD $VERSION"
|
|
|
|
mongo ${MONGO_URL} --username=${MONGO_USERNAME} --password=${MONGO_PASSWORD} -eval "db.application.updateOne({}, {\$set: { \"$FIELD\": \"$VERSION\"}});"
|