mirror of
https://github.com/nvm-sh/nvm.git
synced 2025-09-07 21:17:53 +00:00

committed by
Jordan Harband

parent
1b14e6b4d9
commit
e7b42198b4
33
test/fast/Running "nvm use" should drop CR char automatically.
Executable file
33
test/fast/Running "nvm use" should drop CR char automatically.
Executable file
@@ -0,0 +1,33 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -ex
|
||||
|
||||
die () { echo "$@" ; cleanup ; exit 1; }
|
||||
|
||||
cleanup() {
|
||||
unset VERSION1 VERSION2 VERSION3
|
||||
rm .nvmrc
|
||||
}
|
||||
|
||||
\. ../../nvm.sh
|
||||
|
||||
# normal .nvmrc
|
||||
printf '0.999.0\n' > .nvmrc
|
||||
nvm_rc_version
|
||||
VERSION1="${NVM_RC_VERSION}"
|
||||
|
||||
# .nvmrc with CR char
|
||||
printf '0.999.0\r\n' > .nvmrc
|
||||
nvm_rc_version
|
||||
VERSION2="${NVM_RC_VERSION}"
|
||||
|
||||
[ "${VERSION1}" = "${VERSION2}" ]
|
||||
|
||||
# .nvmrc without any newline char
|
||||
printf '0.999.0' > .nvmrc
|
||||
nvm_rc_version
|
||||
VERSION3="${NVM_RC_VERSION}"
|
||||
|
||||
[ "${VERSION1}" = "${VERSION3}" ]
|
||||
|
||||
cleanup
|
Reference in New Issue
Block a user