Skip to content

Commit

Permalink
more robust compose check
Browse files Browse the repository at this point in the history
  • Loading branch information
BYK committed Mar 3, 2025
1 parent d8d14e1 commit 29467cf
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions install/dc-detect-version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,13 @@ dc_base="$(docker compose version &>/dev/null && echo 'docker compose' || echo '
dc_base_standalone="$(docker-compose version &>/dev/null && echo 'docker-compose' || echo '')"

COMPOSE_VERSION=$($dc_base version --short || echo '')
if [[ -z "$COMPOSE_VERSION" ]]; then
echo "FAIL: Docker compose is required to run self-hosted"
STANDALONE_COMPOSE_VERSION=$($dc_base_standalone version --short &>/dev/null || echo '')

if [[ -z "$COMPOSE_VERSION" || -z "$STANDALONE_COMPOSE_VERSION" ]]; then
echo "FAIL: Docker Compose is required to run self-hosted"
exit 1
fi

STANDALONE_COMPOSE_VERSION=$($dc_base_standalone version --short &>/dev/null || echo '')
if [[ ! -z "${STANDALONE_COMPOSE_VERSION}" ]]; then
if [[ "$(vergte ${COMPOSE_VERSION//v/} ${STANDALONE_COMPOSE_VERSION//v/})" -eq 1 ]]; then
COMPOSE_VERSION="${STANDALONE_COMPOSE_VERSION}"
Expand Down

0 comments on commit 29467cf

Please sign in to comment.