Skip to content

plugin/node.js: don’t overwrite already-set variables #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: node-env
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions plugins/available/nenv.plugin.bash
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,10 @@ about-plugin 'Node.js environment management using https://github.com/ryuone/nen
# Load after basher
# BASH_IT_LOAD_PRIORITY: 260

export NENV_ROOT="${NENV_ROOT:-${HOME?}/.nenv}"
: "${NENV_ROOT:=${HOME?}/.nenv}"
export NENV_ROOT

if [[ -d "${NENV_ROOT?}/bin" ]]; then
pathmunge "${NENV_ROOT?}/bin"
fi
pathmunge "${NENV_ROOT?}/bin"

if _command_exists nenv; then
eval "$(nenv init - bash)"
Expand Down
7 changes: 3 additions & 4 deletions plugins/available/nodenv.plugin.bash
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,10 @@ about-plugin 'Node.js environment management using https://github.com/nodenv/nod
# Load after basher
# BASH_IT_LOAD_PRIORITY: 260

export NODENV_ROOT="${NODENV_ROOT:-${HOME?}/.nodenv}"
: "${NODENV_ROOT:=${HOME?}/.nodenv}"
export NODENV_ROOT

if [[ -d "${NODENV_ROOT?}/bin" ]]; then
pathmunge "${NODENV_ROOT?}/bin"
fi
pathmunge "${NODENV_ROOT?}/bin"

if _command_exists nodenv; then
eval "$(nodenv init - bash)"
Expand Down
3 changes: 2 additions & 1 deletion plugins/available/nvm.plugin.bash
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ about-plugin 'Node.js version manager, https://github.com/nvm-sh/nvm'
# Load after basher
# BASH_IT_LOAD_PRIORITY: 260

export NVM_DIR="${NVM_DIR:-${HOME?}/.nvm}"
: "${NVM_DIR:=${HOME?}/.nvm}"
export NVM_DIR

if _bash_it_homebrew_check && [[ -s "${BASH_IT_HOMEBREW_PREFIX?}/nvm.sh" ]]; then
source "${BASH_IT_HOMEBREW_PREFIX?}/nvm.sh"
Expand Down