Skip to content

Commit

Permalink
moved sourcing of config files above GENERAL_FLAGS
Browse files Browse the repository at this point in the history
  • Loading branch information
netbrain committed May 12, 2024
1 parent f679ae7 commit 4613282
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions zwift.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 ]]
Expand Down Expand Up @@ -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
fi

0 comments on commit 4613282

Please sign in to comment.