Skip to content

Commit

Permalink
fix: Add missing functions.sh
Browse files Browse the repository at this point in the history
Signed-off-by: Julius Härtl <[email protected]>
  • Loading branch information
juliusknorr committed Dec 15, 2023
1 parent d8596f8 commit ff272e6
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions scripts/functions.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/bash

function get_docker_compose_command() {
docker-compose version >/dev/null 2>/dev/null && DCC='docker-compose'
docker compose version >/dev/null 2>/dev/null && DCC='docker compose'
if [ -z "$DCC" ]; then
return
fi
echo "$DCC"
}

function docker_compose() {
DCC=$(get_docker_compose_command)
if [ -z "$DCC" ]; then
echo "❌ Install docker-compose before running this script"
exit 1
fi
$DCC "$@"
}

0 comments on commit ff272e6

Please sign in to comment.