Skip to content

Commit

Permalink
Merge pull request #21 from fuchs-fabian/hotfix-no-docker-compose-cmd…
Browse files Browse the repository at this point in the history
…-found-and-disable-summary-on-exit

Hotfix no Docker Compose command found and option to disable summary on exit
  • Loading branch information
fuchs-fabian authored Nov 23, 2024
2 parents bee988e + 5ed6909 commit e6915ca
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 4 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,8 @@ Usage: (sudo) domposy
--notifier [notifier] 'simbashlog' notifier (https://github.com/fuchs-fabian/simbashlog-notifiers)
Important: The notifier must be correctly installed
Default: none
--disable-summary-on-exit Disables the summary on exit
```

### Example
Expand Down
22 changes: 18 additions & 4 deletions src/domposy.bash
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
# ░░ ░░
# ░░░░░░░░░░░░░░░░░░░░░▓▓▓░░░░░░░░░░░░░░░░░░░░░░

declare -rx CONST_DOMPOSY_VERSION="2.1.0"
declare -rx CONST_DOMPOSY_VERSION="2.2.0"
declare -rx CONST_DOMPOSY_NAME="domposy"

# ░░░░░░░░░░░░░░░░░░░░░▓▓▓░░░░░░░░░░░░░░░░░░░░░░
Expand Down Expand Up @@ -378,6 +378,8 @@ function _process_arguments {
echo " --notifier [notifier] '$CONST_SIMBASHLOG_NAME' notifier ($CONST_SIMBASHLOG_NOTIFIERS_GITHUB_LINK)"
echo " Important: The notifier must be correctly installed"
echo " Default: none"
echo
echo " --disable-summary-on-exit Disables the summary on exit"

# shellcheck disable=SC2034
ENABLE_SUMMARY_ON_EXIT=false
Expand Down Expand Up @@ -498,6 +500,12 @@ function _process_arguments {
SIMBASHLOG_NOTIFIER="$1"
log_debug_var "_process_arguments" "SIMBASHLOG_NOTIFIER"
;;
--disable-summary-on-exit)
log_debug "'$1' selected"

# shellcheck disable=SC2034
ENABLE_SUMMARY_ON_EXIT=false
;;
*)
# shellcheck disable=SC2034
ENABLE_SUMMARY_ON_EXIT=false
Expand Down Expand Up @@ -538,13 +546,19 @@ function get_docker_compose_cmd {
echo "docker-compose"
elif docker compose version &>/dev/null; then
echo "docker compose"
else
log_error "Neither 'docker-compose' nor 'docker compose' command found. Is it installed?"
fi
}

function _set_docker_compose_cmd {
DOCKER_COMPOSE_CMD=$(get_docker_compose_cmd)
local docker_compose_cmd
docker_compose_cmd=$(get_docker_compose_cmd)

if is_var_empty "$docker_compose_cmd"; then
log_error "No Docker Compose command found. Please install 'docker-compose' or 'docker compose'."
fi

DOCKER_COMPOSE_CMD="$docker_compose_cmd"

log_debug "'${DOCKER_COMPOSE_CMD}' is used"

local version_output
Expand Down

0 comments on commit e6915ca

Please sign in to comment.