diff --git a/lib/core.sh b/lib/core.sh index 60bb2a5..1c29223 100644 --- a/lib/core.sh +++ b/lib/core.sh @@ -5,6 +5,8 @@ # the command instead of running it. Messages go to stderr so that stdout stays # usable for data (myos env, myos config, myos ls). +# Exit codes and colors are consumed by the other lib/ files and by bin/myos. +# shellcheck disable=SC2034 MYOS_E_OK=0 # success MYOS_E_FAIL=1 # command failed MYOS_E_USAGE=2 # bad invocation diff --git a/lib/naming.sh b/lib/naming.sh index a78644b..f25cc0b 100644 --- a/lib/naming.sh +++ b/lib/naming.sh @@ -33,6 +33,8 @@ myos_resu() { _niamod=$(myos_reverse "$(printf '%s' "$_domain" | tr '.' ' ')" | tr ' ' '.') _resu=$(myos_reverse "$(printf '%s' "$_user" | tr '.' ' ')" | tr ' ' '.') MYOS_RESU_NIAMOD="$_niamod.$_resu" + # consumed by the User stacks, not by this file + # shellcheck disable=SC2034 MYOS_RESU_PATH=$(printf '%s' "$MYOS_RESU_NIAMOD" | tr '.' '/') printf '%s.%s' "$_user" "$_domain" } @@ -47,6 +49,8 @@ myos_project_name() { [ -n "${DOCKER_COMPOSE_PROJECT_NAME:-}" ] && { printf '%s' "$DOCKER_COMPOSE_PROJECT_NAME"; return 0; } case $_scope in host) + # HOSTNAME is set by lib/config.sh, not inherited from the shell + # shellcheck disable=SC3028 printf '%s' "${HOST_COMPOSE_PROJECT_NAME:-${HOSTNAME:-localhost}}"; return 0 ;; user) if [ -n "${USER_COMPOSE_PROJECT_NAME:-}" ]; then printf '%s' "$USER_COMPOSE_PROJECT_NAME"