Browse Source

fix: config files list is specific by os

Signed-off-by: Valentin Lab <valentin.lab@kalysto.org>
lokavaluto/dev/master
Valentin Lab 5 years ago
parent
commit
796e60af8c
  1. 62
      bin/compose

62
bin/compose

@ -655,6 +655,23 @@ set_os() {
OS="$(get_os)" OS="$(get_os)"
case "$OS" in case "$OS" in
linux) linux)
## Order matters, files get to override vars
compose_config_files=(
## DEFAULT LINUX VARS
/etc/default/charm
/etc/default/datastore
/etc/default/compose
## COMPOSE SYSTEM-WIDE FILES
/etc/compose.conf
/etc/compose.local.conf
/etc/compose/local.conf
## COMPOSE USER FILES
~/.compose/etc/local.conf
~/.compose.conf
)
COMPOSE_LOCAL_ROOT=${COMPOSE_LOCAL_ROOT:-"$HOME/.compose"} COMPOSE_LOCAL_ROOT=${COMPOSE_LOCAL_ROOT:-"$HOME/.compose"}
COMPOSE_VAR=${COMPOSE_VAR:-/var/lib/compose} COMPOSE_VAR=${COMPOSE_VAR:-/var/lib/compose}
COMPOSE_CACHE=${COMPOSE_CACHE:-/var/cache/compose} COMPOSE_CACHE=${COMPOSE_CACHE:-/var/cache/compose}
@ -673,6 +690,18 @@ set_os() {
fi fi
;; ;;
mac) mac)
## Order matters, files get to override vars
compose_config_files=(
## COMPOSE SYSTEM-WIDE FILES
/etc/compose.conf
/etc/compose.local.conf
/etc/compose/local.conf
## COMPOSE USER FILES
~/.compose/etc/local.conf
~/.compose.conf
)
COMPOSE_LOCAL_ROOT=${COMPOSE_LOCAL_ROOT:-"$HOME/.compose"} COMPOSE_LOCAL_ROOT=${COMPOSE_LOCAL_ROOT:-"$HOME/.compose"}
COMPOSE_VAR=${COMPOSE_VAR:-"$COMPOSE_LOCAL_ROOT"/lib} COMPOSE_VAR=${COMPOSE_VAR:-"$COMPOSE_LOCAL_ROOT"/lib}
COMPOSE_CACHE=${COMPOSE_CACHE:-"$COMPOSE_LOCAL_ROOT"/cache} COMPOSE_CACHE=${COMPOSE_CACHE:-"$COMPOSE_LOCAL_ROOT"/cache}
@ -703,6 +732,22 @@ set_os() {
WIN_HOME="$(wsl_path_env UserProfile)" WIN_HOME="$(wsl_path_env UserProfile)"
WIN_PROGRAM_FILES="$(wsl_path_env ProgramFiles)" WIN_PROGRAM_FILES="$(wsl_path_env ProgramFiles)"
## Order matters, files get to override vars
compose_config_files=(
## COMPOSE SYSTEM-WIDE FILES
/etc/compose.conf
/etc/compose.local.conf
/etc/compose/local.conf
## COMPOSE USER FILES
~/.compose/etc/local.conf
~/.compose.conf
## COMPOSE USER FILES
{~,"$WIN_HOME"}/.compose/etc/local.conf
{~,"$WIN_HOME"}/.compose.conf
)
COMPOSE_LAUNCHER_APP_DIR="$WIN_PROGRAM_FILES/Compose" COMPOSE_LAUNCHER_APP_DIR="$WIN_PROGRAM_FILES/Compose"
COMPOSE_LOCAL_ROOT=${COMPOSE_LOCAL_ROOT:-"$WIN_HOME/AppData/Local/Compose/Launcher"} COMPOSE_LOCAL_ROOT=${COMPOSE_LOCAL_ROOT:-"$WIN_HOME/AppData/Local/Compose/Launcher"}
@ -728,23 +773,6 @@ set_os() {
mk_docker_run_options() { mk_docker_run_options() {
## Order matters, files get to override vars
compose_config_files=(
## DEFAULT LINUX VARS
/etc/default/charm
/etc/default/datastore
/etc/default/compose
## COMPOSE SYSTEM-WIDE FILES
/etc/compose.conf
/etc/compose.local.conf
/etc/compose/local.conf
## COMPOSE USER FILES
~/.compose/etc/local.conf
~/.compose.conf
)
set_os || return 1 set_os || return 1
docker_run_opts=("-v" "/var/run/docker.sock:/var/run/docker.sock") docker_run_opts=("-v" "/var/run/docker.sock:/var/run/docker.sock")

Loading…
Cancel
Save