From 4613282f1db2f129e5a9b46adf96fca7d9d522a8 Mon Sep 17 00:00:00 2001 From: Kim Eik Date: Sun, 12 May 2024 21:36:34 +0200 Subject: [PATCH] moved sourcing of config files above GENERAL_FLAGS --- zwift.sh | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/zwift.sh b/zwift.sh index 9052d25..2faaeac 100755 --- a/zwift.sh +++ b/zwift.sh @@ -25,6 +25,20 @@ NETWORKING=${NETWORKING:-bridge} ZWIFT_UID=${ZWIFT_UID:-$(id -u)} ZWIFT_GID=${ZWIFT_GID:-$(id -g)} +# Check for other zwift configuration, sourced here and passed on to container aswell +if [[ -f "$HOME/.config/zwift/config" ]] +then + ZWIFT_CONFIG_FLAG="--env-file $HOME/.config/zwift/config" + source $HOME/.config/zwift/config +fi + +# Check for $USER specific zwift configuration, sourced here and passed on to container aswell +if [[ -f "$HOME/.config/zwift/$USER-config" ]] +then + ZWIFT_USER_CONFIG_FLAG="--env-file $HOME/.config/zwift/config" + source $HOME/.config/zwift/config +fi + # Define Base Container Parameters GENERAL_FLAGS=( -d @@ -45,20 +59,6 @@ GENERAL_FLAGS=( -v zwift-$USER:/home/user/.wine/drive_c/users/user/Documents/Zwift ) -# Check for other zwift configuration, sourced here and passed on to container aswell -if [[ -f "$HOME/.config/zwift/config" ]] -then - ZWIFT_CONFIG_FLAG="--env-file $HOME/.config/zwift/config" - source $HOME/.config/zwift/config -fi - -# Check for $USER specific zwift configuration, sourced here and passed on to container aswell -if [[ -f "$HOME/.config/zwift/$USER-config" ]] -then - ZWIFT_USER_CONFIG_FLAG="--env-file $HOME/.config/zwift/config" - source $HOME/.config/zwift/config -fi - ### UPD SCRIPTS and CONTAINER ### # Check for updated zwift.sh if [[ ! $DONT_CHECK ]] @@ -165,4 +165,4 @@ CONTAINER=$($CONTAINER_TOOL run ${GENERAL_FLAGS[@]} \ if [[ -z $WAYLAND_DISPLAY && $ZWIFT_UID -ne $(id -u) ]] then xhost +local:$($CONTAINER_TOOL inspect --format='{{ .Config.Hostname }}' $CONTAINER) -fi \ No newline at end of file +fi