mirror of
https://github.com/nvm-sh/nvm.git
synced 2025-10-30 00:45:49 +08:00
Don't bother testing --install option on source, or supporting it, unless the shell supports passing options upon sourcing.
This commit is contained in:
@@ -1,6 +1,14 @@
|
||||
#!/bin/sh
|
||||
|
||||
die () { echo $@ ; exit 1; }
|
||||
supports_source_options () {
|
||||
[ "_$(echo 'echo $1' | . /dev/stdin yes)" = "_yes" ]
|
||||
}
|
||||
|
||||
if ! supports_source_options; then
|
||||
echo 'this shell does not support passing options on sourcing'
|
||||
exit 0;
|
||||
fi
|
||||
|
||||
echo '0.10.2' > ../../.nvmrc || die 'creation of .nvmrc failed'
|
||||
|
||||
|
||||
@@ -1,6 +1,14 @@
|
||||
#!/bin/sh
|
||||
|
||||
die () { echo $@ ; exit 1; }
|
||||
supports_source_options () {
|
||||
[ "_$(echo 'echo $1' | . /dev/stdin yes)" = "_yes" ]
|
||||
}
|
||||
|
||||
if ! supports_source_options; then
|
||||
echo 'this shell does not support passing options on sourcing'
|
||||
exit 0;
|
||||
fi
|
||||
|
||||
echo '0.10.2' > ../../alias/default || die 'creation of default alias failed'
|
||||
|
||||
|
||||
Reference in New Issue
Block a user