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

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

No files matched your search

@@ -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"'