Browse Source

fix: [vps] improve detection of ``compose.yml`` path

master
Valentin Lab 9 months ago
parent
commit
0bdf27d7dc
  1. 10
      bin/vps

10
bin/vps

@ -79,9 +79,8 @@ compose:get-compose-yml() {
:cache: scope=session
local path
[ -e "/etc/compose/local.conf" ] && . "/etc/compose/local.conf"
path=${DEFAULT_COMPOSE_FILE:-/etc/compose/compose.yml}
path=$(DEBUG=1 DRY_RUN=1 compose 2>&1 | egrep '^\s+-e HOST_COMPOSE_YML_FILE=' | cut -f 2- -d "=" | cut -f 1 -d " ")
[ -e "$path" ] || return 1
echo "$path"
@ -99,7 +98,12 @@ compose:has-container-project-myc() {
compose:file:value-change() {
local key="$1" value="$2"
yaml:file:value-change "$(compose:get-compose-yml)" "$key" "$value" || exit 1
local compose_yml
if ! compose_yml=$(compose:get-compose-yml); then
err "Couldn't locate your 'compose.yml' file."
return 1
fi
yaml:file:value-change "$compose_yml" "$key" "$value" || return 1
}
export -f compose:file:value-change

Loading…
Cancel
Save