[Fix] `nvm ls-remote`: accept versions that end with a dot
Fixes #983.
parent
f2c5ce459a
commit
c72f2c6f21
4
nvm.sh
4
nvm.sh
|
@ -1240,6 +1240,10 @@ nvm_ls_remote_index_tab() {
|
||||||
local PATTERN
|
local PATTERN
|
||||||
PATTERN="${3-}"
|
PATTERN="${3-}"
|
||||||
|
|
||||||
|
if [ "${PATTERN#"${PATTERN%?}"}" = '.' ]; then
|
||||||
|
PATTERN="${PATTERN%.}"
|
||||||
|
fi
|
||||||
|
|
||||||
local VERSIONS
|
local VERSIONS
|
||||||
if [ -n "${PATTERN}" ] && [ "${PATTERN}" != '*' ]; then
|
if [ -n "${PATTERN}" ] && [ "${PATTERN}" != '*' ]; then
|
||||||
if [ "${FLAVOR}" = 'iojs' ]; then
|
if [ "${FLAVOR}" = 'iojs' ]; then
|
||||||
|
|
|
@ -40,6 +40,19 @@ v0.3.8"
|
||||||
|
|
||||||
[ "_$OUTPUT" = "_$EXPECTED_OUTPUT" ] || die "nvm_ls_remote 0.3 did not output 0.3.x versions; got $OUTPUT"
|
[ "_$OUTPUT" = "_$EXPECTED_OUTPUT" ] || die "nvm_ls_remote 0.3 did not output 0.3.x versions; got $OUTPUT"
|
||||||
|
|
||||||
|
OUTPUT="$(nvm_ls_remote 0.3.)"
|
||||||
|
EXPECTED_OUTPUT="v0.3.0
|
||||||
|
v0.3.1
|
||||||
|
v0.3.2
|
||||||
|
v0.3.3
|
||||||
|
v0.3.4
|
||||||
|
v0.3.5
|
||||||
|
v0.3.6
|
||||||
|
v0.3.7
|
||||||
|
v0.3.8"
|
||||||
|
|
||||||
|
[ "_$OUTPUT" = "_$EXPECTED_OUTPUT" ] || die "nvm_ls_remote 0.3. did not output 0.3.x versions; got $OUTPUT"
|
||||||
|
|
||||||
# Sanity checks
|
# Sanity checks
|
||||||
OUTPUT="$(nvm_print_implicit_alias remote stable)"
|
OUTPUT="$(nvm_print_implicit_alias remote stable)"
|
||||||
EXPECTED_OUTPUT_PATH="${MOCKS_DIR}/nvm_print_implicit_alias remote stable.txt"
|
EXPECTED_OUTPUT_PATH="${MOCKS_DIR}/nvm_print_implicit_alias remote stable.txt"
|
||||||
|
|
Loading…
Reference in New Issue