plugins/nvm: use `_command_exists`
Addresses bash-it/bash-it#1632 alsö, quote variable, &c.pull/1938/head
parent
a7955b972c
commit
9378a8318f
|
|
@ -1,22 +1,23 @@
|
|||
# Bash-it no longer bundles nvm, as this was quickly becoming outdated.
|
||||
# shellcheck shell=bash
|
||||
#
|
||||
# BASH_IT_LOAD_PRIORITY: 225
|
||||
#
|
||||
# Bash-it no longer bundles nvm, as this was quickly becoming outdated.
|
||||
# Please install nvm from https://github.com/creationix/nvm.git if you want to use it.
|
||||
|
||||
cite about-plugin
|
||||
about-plugin 'node version manager configuration'
|
||||
|
||||
export NVM_DIR=${NVM_DIR:-$HOME/.nvm}
|
||||
export NVM_DIR="${NVM_DIR:-$HOME/.nvm}"
|
||||
# This loads nvm
|
||||
if _bash_it_homebrew_check && [ -s "${BASH_IT_HOMEBREW_PREFIX}/nvm.sh" ]
|
||||
if _bash_it_homebrew_check && [[ -s "${BASH_IT_HOMEBREW_PREFIX}/nvm.sh" ]]
|
||||
then
|
||||
. "${BASH_IT_HOMEBREW_PREFIX}/nvm.sh"
|
||||
source "${BASH_IT_HOMEBREW_PREFIX}/nvm.sh"
|
||||
else
|
||||
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh"
|
||||
[[ -s "$NVM_DIR/nvm.sh" ]] && source "$NVM_DIR/nvm.sh"
|
||||
fi
|
||||
|
||||
if ! command -v nvm &>/dev/null
|
||||
if ! _command_exists nvm
|
||||
then
|
||||
function nvm() {
|
||||
echo "Bash-it no longer bundles the nvm script. Please install the latest version from"
|
||||
|
|
|
|||
Loading…
Reference in New Issue