Skip to content

Commit

Permalink
rebuild env file atomically
Browse files Browse the repository at this point in the history
  • Loading branch information
qrkourier committed Aug 31, 2023
1 parent 04c9dce commit 57baac3
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions quickstart/docker/image/ziti-cli-functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -390,13 +390,16 @@ function setupEnvironment {
function persistEnvironmentValues {
local filepath tmpfilepath retVal envval envvar zEnvVar
# Get the file path
if [[ -n "${ZITI_ENV_FILE:-}" ]]; then
filepath="${ZITI_ENV_FILE}"
elif (( $# )); then
filepath="${1}"
else
echo -e "$(RED " --- persistEnvironmentValues() needs a filepath parameter or have ZITI_ENV_FILE set ---")"
return 1
filepath="${1-}"
if [[ "" == "${filepath}" ]]; then
_check_env_variable ZITI_ENV_FILE
retVal=$?
if [[ "${retVal}" != 0 ]]; then
echo -e "$(RED " --- persistEnvironment must take a parameter or have ZITI_ENV_FILE set ---")"
return 1
else
filepath="${ZITI_ENV_FILE}"
fi
fi

# Store all ZITI_ variables in the environment file, creating the directory if necessary
Expand Down

0 comments on commit 57baac3

Please sign in to comment.