Skip to content

Commit

Permalink
Fix stripping of '-' character from project names/urls
Browse files Browse the repository at this point in the history
  • Loading branch information
bap14 committed Jul 30, 2023
1 parent f7a1ce8 commit 9b3c387
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions commands/status.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ IFS="$OLDIFS"

messageList=()
for projectNetwork in "${projectNetworkList[@]}"; do
[[ -z "${projectNetwork}" || "${projectNetwork}" == "${wardenNetworkName}" ]] && continue # Skip empty project network names (if any)
# Skip empty names and the Warden core services network
test -z "${projectNetwork}" -o "${projectNetwork}" = "${wardenNetworkName}" && continue

prefix="${projectNetwork%_default}"
prefixLen="${#prefix}"
Expand All @@ -28,9 +29,9 @@ for projectNetwork in "${projectNetworkList[@]}"; do
[[ -z "${container}" ]] && continue # Project is not running, skip it

projectDir=$(docker container inspect --format '{{ index .Config.Labels "com.docker.compose.project.working_dir"}}' "$container")
projectName=$(cat "${projectDir}/.env" | grep '^WARDEN_ENV_NAME=' | sed -e 's/WARDEN_ENV_NAME=[[:space:]]*//g' | tr -d -)
projectType=$(cat "${projectDir}/.env" | grep '^WARDEN_ENV_TYPE=' | sed -e 's/WARDEN_ENV_TYPE=[[:space:]]*//g' | tr -d -)
traefikDomain=$(cat "${projectDir}/.env" | grep '^TRAEFIK_DOMAIN=' | sed -e 's/TRAEFIK_DOMAIN=[[:space:]]*//g' | tr -d -)
projectName=$(cat "${projectDir}/.env" | grep '^WARDEN_ENV_NAME=' | sed -e 's/WARDEN_ENV_NAME=[[:space:]]*//g')
projectType=$(cat "${projectDir}/.env" | grep '^WARDEN_ENV_TYPE=' | sed -e 's/WARDEN_ENV_TYPE=[[:space:]]*//g')
traefikDomain=$(cat "${projectDir}/.env" | grep '^TRAEFIK_DOMAIN=' | sed -e 's/TRAEFIK_DOMAIN=[[:space:]]*//g')

messageList+=(" \033[1;35m${projectName}\033[0m a \033[36m${projectType}\033[0m project")
messageList+=(" Project Directory: \033[33m${projectDir}\033[0m")
Expand Down

0 comments on commit 9b3c387

Please sign in to comment.