Update script: Fix path of compose file when not run from script folder.

This commit is contained in:
Viyurz 2024-01-09 08:36:48 +01:00
parent e98c9a6d21
commit 54c94e0e0a

View file

@ -30,7 +30,7 @@ function up {
# Checks if at least one container can be updated # Checks if at least one container can be updated
# $1 = project name # $1 = project name
function has_update { function has_update {
readarray -t cont_list < <(docker-compose -f "$1/docker-compose.yaml" ps -a | tail -n+3 | cut -d ' ' -f 1) readarray -t cont_list < <(docker-compose -f "$rel_path/$1/docker-compose.yaml" ps -a | tail -n+3 | cut -d ' ' -f 1)
for cont in "${cont_list[@]}"; do for cont in "${cont_list[@]}"; do
# Return true if container doesn't exist # Return true if container doesn't exist
if ! docker ps -a --format='{{.Names}}' | grep -q "$cont"; then if ! docker ps -a --format='{{.Names}}' | grep -q "$cont"; then