Skip to content

Commit

Permalink
Fix unbound variable error in install script (#3601)
Browse files Browse the repository at this point in the history
  • Loading branch information
brettdh authored Mar 6, 2025
1 parent d08a6d9 commit 979f219
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
1 change: 0 additions & 1 deletion install/_lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ function ensure_file_from_example {
# Check the version of $1 is greater than or equal to $2 using sort. Note: versions must be stripped of "v"
function vergte() {
printf "%s\n%s" $1 $2 | sort --version-sort --check=quiet --reverse
echo $?
}

SENTRY_CONFIG_PY=sentry/sentry.conf.py
Expand Down
4 changes: 2 additions & 2 deletions install/check-minimum-requirements.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ if [[ -z "$DOCKER_VERSION" ]]; then
exit 1
fi

if [[ "$(vergte ${DOCKER_VERSION//v/} $MIN_DOCKER_VERSION)" -eq 1 ]]; then
if ! vergte ${DOCKER_VERSION//v/} $MIN_DOCKER_VERSION; then
echo "FAIL: Expected minimum docker version to be $MIN_DOCKER_VERSION but found $DOCKER_VERSION"
exit 1
fi
echo "Found Docker version $DOCKER_VERSION"

if [[ "$(vergte ${COMPOSE_VERSION//v/} $MIN_COMPOSE_VERSION)" -eq 1 ]]; then
if ! vergte ${COMPOSE_VERSION//v/} $MIN_COMPOSE_VERSION; then
echo "FAIL: Expected minimum $dc_base version to be $MIN_COMPOSE_VERSION but found $COMPOSE_VERSION"
exit 1
fi
Expand Down
2 changes: 1 addition & 1 deletion install/dc-detect-version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ if [[ -z "$COMPOSE_VERSION" && -z "$STANDALONE_COMPOSE_VERSION" ]]; then
exit 1
fi

if [[ -z "$COMPOSE_VERSION" || -n "$STANDALONE_COMPOSE_VERSION" && "$(vergte ${COMPOSE_VERSION//v/} ${STANDALONE_COMPOSE_VERSION//v/})" -eq 1 ]]; then
if [[ -z "$COMPOSE_VERSION" ]] || [[ -n "$STANDALONE_COMPOSE_VERSION" ]] && ! vergte ${COMPOSE_VERSION//v/} ${STANDALONE_COMPOSE_VERSION//v/}; then
COMPOSE_VERSION="${STANDALONE_COMPOSE_VERSION}"
dc_base="$dc_base_standalone"
fi
Expand Down

0 comments on commit 979f219

Please sign in to comment.