annotate the cross-file variables for shellcheck
This commit is contained in:
@@ -5,6 +5,8 @@
|
|||||||
# the command instead of running it. Messages go to stderr so that stdout stays
|
# the command instead of running it. Messages go to stderr so that stdout stays
|
||||||
# usable for data (myos env, myos config, myos ls).
|
# 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_OK=0 # success
|
||||||
MYOS_E_FAIL=1 # command failed
|
MYOS_E_FAIL=1 # command failed
|
||||||
MYOS_E_USAGE=2 # bad invocation
|
MYOS_E_USAGE=2 # bad invocation
|
||||||
|
|||||||
@@ -33,6 +33,8 @@ myos_resu() {
|
|||||||
_niamod=$(myos_reverse "$(printf '%s' "$_domain" | tr '.' ' ')" | tr ' ' '.')
|
_niamod=$(myos_reverse "$(printf '%s' "$_domain" | tr '.' ' ')" | tr ' ' '.')
|
||||||
_resu=$(myos_reverse "$(printf '%s' "$_user" | tr '.' ' ')" | tr ' ' '.')
|
_resu=$(myos_reverse "$(printf '%s' "$_user" | tr '.' ' ')" | tr ' ' '.')
|
||||||
MYOS_RESU_NIAMOD="$_niamod.$_resu"
|
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 '.' '/')
|
MYOS_RESU_PATH=$(printf '%s' "$MYOS_RESU_NIAMOD" | tr '.' '/')
|
||||||
printf '%s.%s' "$_user" "$_domain"
|
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; }
|
[ -n "${DOCKER_COMPOSE_PROJECT_NAME:-}" ] && { printf '%s' "$DOCKER_COMPOSE_PROJECT_NAME"; return 0; }
|
||||||
case $_scope in
|
case $_scope in
|
||||||
host)
|
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 ;;
|
printf '%s' "${HOST_COMPOSE_PROJECT_NAME:-${HOSTNAME:-localhost}}"; return 0 ;;
|
||||||
user)
|
user)
|
||||||
if [ -n "${USER_COMPOSE_PROJECT_NAME:-}" ]; then printf '%s' "$USER_COMPOSE_PROJECT_NAME"
|
if [ -n "${USER_COMPOSE_PROJECT_NAME:-}" ]; then printf '%s' "$USER_COMPOSE_PROJECT_NAME"
|
||||||
|
|||||||
Reference in New Issue
Block a user