File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change
1
+ #! /bin/sh
2
+
3
+ set -ex
4
+
5
+ die () { echo $@ ; exit 1; }
6
+
7
+ . ../../../nvm.sh
8
+
9
+ echo " 0.10.7" > .nvmrc
10
+
11
+ # Check nvm run without --silent
12
+ OUTPUT=" $( nvm run --version | awk ' {print $6}' ) "
13
+ EXPECTED_OUTPUT=" <v0.10.7>"
14
+ [ " ${OUTPUT} " = " ${EXPECTED_OUTPUT} " ] /
15
+ || die " \` nvm run\` failed to run; did not match with the .nvmrc version; got >${OUTPUT} <"
16
+
17
+ OUTPUT=" $( nvm run --silent --version) "
18
+ EXPECTED_OUTPUT=" "
19
+ [ " ${OUTPUT} " = " ${EXPECTED_OUTPUT} " ] /
20
+ || die " \` nvm run --silent\` failed to run silently; expected no output, got >${OUTPUT} <"
21
+
22
+ # Output shouldn't be silent if --silent flag is not at the third argument position
23
+ OUTPUT=" $( nvm run --version --silent) "
24
+ EXPECTED_OUTPUT=" "
25
+ [ " ${OUTPUT} " -ne " ${EXPECTED_OUTPUT} " ] /
26
+ || die " \` nvm run --version --silent\` should not be silent; expected >${OUTPUT} <, got no output"
You can’t perform that action at this time.
0 commit comments