[Fix] Remove $NVM_DIR trailing slash automatically, fix #1708

This commit is contained in:
Peter Dave Hello
2018-04-12 14:14:58 +08:00
committed by Jordan Harband
parent 42f11acce1
commit 685312d600
2 changed files with 23 additions and 0 deletions

View File

@@ -0,0 +1,18 @@
#!/bin/sh
set -ex
die () { echo "$@" ; exit 1; }
export NVM_DIR_BASE="/tmp"
export NVM_DIR="${NVM_DIR_BASE}/"
\. ../../nvm.sh
[ "${NVM_DIR}" = "${NVM_DIR_BASE}" ] || die 'nvm should remove the last trailing slash in "$NVM_DIR"'
export NVM_DIR="${NVM_DIR_BASE}//"
\. ../../nvm.sh
[ "${NVM_DIR}" = "${NVM_DIR_BASE}" ] || die 'nvm should remove all the last trailing slashes in "$NVM_DIR"'