1
0
mirror of https://github.com/ohmyzsh/ohmyzsh.git synced 2026-03-29 19:14:05 +08:00

chore: rename gloabal variables

This commit is contained in:
Oleksandr Molchanov 2026-03-13 21:16:15 +02:00
parent d6bce941ee
commit 1aa896ebe3
2 changed files with 12 additions and 12 deletions

View File

@ -216,10 +216,10 @@ In case you would like to have more control over kube environment context, you c
| `KUBE_ENV_PADDING` | one space | Padding (spaces or characters) added around the environment block |
| `KUBE_ENV_OPEN_SYMBOL` | `[` | Opening symbol used for the environment block |
| `KUBE_ENV_CLOSE_SYMBOL` | `]` | Closing symbol used for the environment block |
| `KUBE_ENV_PROD` | `prod` | Set default production label |
| `KUBE_ENV_STG` | `stag` | Set default staging label |
| `KUBE_ENV_TEST` | `test` | Set default testing label |
| `KUBE_ENV_DEV` | `dev` | Set default developing label |
| `KUBE_ENV_PROD_LABEL` | `prod` | Set default production label |
| `KUBE_ENV_STG_LABEL` | `stag` | Set default staging label |
| `KUBE_ENV_TEST_LABEL` | `test` | Set default testing label |
| `KUBE_ENV_DEV_LABEL` | `dev` | Set default developing label |
| `KUBE_ENV_PROD_RE` | `(production\|prod)-` | Regex used to detect production in the context name |
| `KUBE_ENV_STG_RE` | `(staging\|stg)-` | Regex used to detect staging in the context name |
| `KUBE_ENV_TEST_RE` | `(testing\|test)-` | Regex used to detect test in the context name |

View File

@ -48,10 +48,10 @@ KUBE_ENV_STG_COLOR="${KUBE_ENV_STG_COLOR:-yellow}"
KUBE_ENV_TEST_COLOR="${KUBE_ENV_TEST_COLOR:-green}"
KUBE_ENV_DEV_COLOR="${KUBE_ENV_DEV_COLOR:-blue}"
KUBE_ENV_PROD="${KUBE_ENV_PROD:-prod}"
KUBE_ENV_STG="${KUBE_ENV_STG:-stag}"
KUBE_ENV_TEST="${KUBE_ENV_TEST:-test}"
KUBE_ENV_DEV="${KUBE_ENV_DEV:-dev}"
KUBE_ENV_PROD_LABEL="${KUBE_ENV_PROD_LABEL:-prod}"
KUBE_ENV_STG_LABEL="${KUBE_ENV_STG_LABEL:-stag}"
KUBE_ENV_TEST_LABEL="${KUBE_ENV_TEST_LABEL:-test}"
KUBE_ENV_DEV_LABEL="${KUBE_ENV_DEV_LABEL:-dev}"
KUBE_ENV_PROD_RE="${KUBE_ENV_PROD_RE:-(production|prod)-}"
KUBE_ENV_STG_RE="${KUBE_ENV_STG_RE:-(staging|stg)-}"
@ -349,19 +349,19 @@ _kube_ps1_set_env_ctx() {
if grep -qE "${KUBE_ENV_PROD_RE}" <<< "${KUBE_PS1_CONTEXT}"; then
_kube_ps1_cut_context "${KUBE_ENV_PROD_RE}"
ctx_color="$(_kube_ps1_color_fg "${KUBE_ENV_PROD_COLOR}")"
env_label="${KUBE_ENV_PROD}"
env_label="${KUBE_ENV_PROD_LABEL}"
elif grep -qE "${KUBE_ENV_STG_RE}" <<< "${KUBE_PS1_CONTEXT}"; then
_kube_ps1_cut_context "${KUBE_ENV_PROD_RE}"
ctx_color="$(_kube_ps1_color_fg "${KUBE_ENV_PROD_COLOR}")"
env_label="${KUBE_ENV_PROD}"
env_label="${KUBE_ENV_PROD_LABEL}"
elif grep -qE "${KUBE_ENV_TEST_RE}" <<< "${KUBE_PS1_CONTEXT}"; then
_kube_ps1_cut_context "${KUBE_ENV_TEST_RE}"
ctx_color="$(_kube_ps1_color_fg "${KUBE_ENV_TEST_COLOR}")"
env_label="${KUBE_ENV_TEST}"
env_label="${KUBE_ENV_TEST_LABEL}"
elif grep -qE "${KUBE_ENV_DEV_RE}" <<< "${KUBE_PS1_CONTEXT}"; then
_kube_ps1_cut_context "${KUBE_ENV_DEV_RE}"
ctx_color="$(_kube_ps1_color_fg "${KUBE_ENV_DEV_COLOR}")"
env_label="${KUBE_ENV_DEV}"
env_label="${KUBE_ENV_DEV_LABEL}"
fi
KUBE_PS1+="${KUBE_ENV_OPEN_SYMBOL}${ctx_color}${env_label}${KUBE_PS1_RESET_COLOR}${KUBE_ENV_CLOSE_SYMBOL}"