Preventing an extra leading newline.
parent
304cc29cf0
commit
b6469ee186
8
nvm.sh
8
nvm.sh
|
@ -55,7 +55,7 @@ nvm_version() {
|
||||||
PATTERN='current'
|
PATTERN='current'
|
||||||
fi
|
fi
|
||||||
|
|
||||||
VERSION=`nvm_ls $PATTERN | tail -n1`
|
VERSION=`nvm_ls $PATTERN`
|
||||||
echo "$VERSION"
|
echo "$VERSION"
|
||||||
|
|
||||||
if [ "$VERSION" = 'N/A' ]; then
|
if [ "$VERSION" = 'N/A' ]; then
|
||||||
|
@ -143,9 +143,9 @@ print_versions() {
|
||||||
if [[ -d "$NVM_DIR/$VERSION" ]]; then
|
if [[ -d "$NVM_DIR/$VERSION" ]]; then
|
||||||
PADDED_VERSION="\033[0;34m$PADDED_VERSION\033[0m"
|
PADDED_VERSION="\033[0;34m$PADDED_VERSION\033[0m"
|
||||||
fi
|
fi
|
||||||
OUTPUT="$OUTPUT\n$PADDED_VERSION"
|
OUTPUT="$OUTPUT$PADDED_VERSION\n"
|
||||||
done
|
done
|
||||||
echo -e "$OUTPUT"
|
echo -ne "$OUTPUT"
|
||||||
}
|
}
|
||||||
|
|
||||||
nvm() {
|
nvm() {
|
||||||
|
@ -520,7 +520,7 @@ nvm() {
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
local VERSION=`nvm_version $2`
|
local VERSION=`nvm_version $2`
|
||||||
local ROOT=`(nvm use $VERSION && npm -g root) | tail -n1`
|
local ROOT=`(nvm use $VERSION && npm -g root)`
|
||||||
local ROOTDEPTH=$((`echo $ROOT | sed 's/[^\/]//g'|wc -m` -1))
|
local ROOTDEPTH=$((`echo $ROOT | sed 's/[^\/]//g'|wc -m` -1))
|
||||||
|
|
||||||
# declare local INSTALLS first, otherwise it doesn't work in zsh
|
# declare local INSTALLS first, otherwise it doesn't work in zsh
|
||||||
|
|
Loading…
Reference in New Issue