mirror of
https://github.com/romkatv/powerlevel10k.git
synced 2024-11-11 00:00:06 +00:00
Remove checking for NODEENV_DISABLE_PROMPT
This variable is none of our buisness.
This commit is contained in:
parent
6ccdfdf37e
commit
2f05bbbb47
2 changed files with 2 additions and 23 deletions
|
@ -1238,9 +1238,8 @@ prompt_nvm() {
|
||||||
################################################################
|
################################################################
|
||||||
# Segment to display NodeEnv
|
# Segment to display NodeEnv
|
||||||
prompt_nodeenv() {
|
prompt_nodeenv() {
|
||||||
local nodeenv_path="$NODE_VIRTUAL_ENV"
|
if [[ -n "$NODE_VIRTUAL_ENV" ]]; then
|
||||||
if [[ -n "$nodeenv_path" && "$NODE_VIRTUAL_ENV_DISABLE_PROMPT" != true ]]; then
|
local info="$(node -v)[${NODE_VIRTUAL_ENV:t}]"
|
||||||
local info="$(node -v)[$(basename "$nodeenv_path")]"
|
|
||||||
"$1_prompt_segment" "$0" "$2" "black" "green" "$info" 'NODE_ICON'
|
"$1_prompt_segment" "$0" "$2" "black" "green" "$info" 'NODE_ICON'
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
|
@ -44,26 +44,6 @@ function testNodeenvSegmentPrintsNothingIfNodeVirtualEnvIsNotSet() {
|
||||||
unfunction node
|
unfunction node
|
||||||
}
|
}
|
||||||
|
|
||||||
function testNodeenvSegmentPrintsNothingIfNodeVirtualEnvDisablePromptIsSet() {
|
|
||||||
local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS
|
|
||||||
POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(nodeenv custom_world)
|
|
||||||
local POWERLEVEL9K_CUSTOM_WORLD='echo world'
|
|
||||||
node() {
|
|
||||||
echo "v1.2.3"
|
|
||||||
}
|
|
||||||
NODE_VIRTUAL_ENV="node-env"
|
|
||||||
NODE_VIRTUAL_ENV_DISABLE_PROMPT=true
|
|
||||||
|
|
||||||
# Load Powerlevel9k
|
|
||||||
source powerlevel9k.zsh-theme
|
|
||||||
|
|
||||||
assertEquals "%K{007} %F{000}world %k%F{007}%f " "$(build_left_prompt)"
|
|
||||||
|
|
||||||
unset NODE_VIRTUAL_ENV_DISABLE_PROMPT
|
|
||||||
unset NODE_VIRTUAL_ENV
|
|
||||||
unfunction node
|
|
||||||
}
|
|
||||||
|
|
||||||
function testNodeenvSegmentPrintsAtLeastNodeEnvWithoutNode() {
|
function testNodeenvSegmentPrintsAtLeastNodeEnvWithoutNode() {
|
||||||
local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS
|
local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS
|
||||||
POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(nodeenv)
|
POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(nodeenv)
|
||||||
|
|
Loading…
Reference in a new issue