fix: Add missing functions.sh

Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
Julius Härtl
2023-12-15 20:25:00 +01:00
parent d8596f8952
commit ff272e6996
+19
View File
@@ -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 "$@"
}