Skip to content
Myr

Adding a test for `nvm install invalid` behavior, and correcting the message.

Before adoption: this commit came in with the history the project adopted, so no landing records it.

From https://github.com/creationix/nvm/commit/f00d688c87873a9e3cffc1dbf54f63e0edd6e69b#commitcomment-6205164

authored by Jordan Harband · committed by Jordan Harband · parent e562a56 · Browse files · 2 files+8 added−1 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+8 added−1 removed

  • tests:+7 added−0 removed
  • other:+1 added−1 removed

2 files+8 added−1 removed

added:test/fast/Running "nvm install" with an invalid version fails nicely+7 added
1#!/bin/sh23die () { echo $@ ; exit 1; }45. ../../nvm.sh6[ "$(nvm install invalid.invalid)" = "Version 'invalid.invalid' not found - try \`nvm ls-remote\` to browse available versions." ] || die "nvm installing an invalid version did not print a nice error message"7
modified:nvm.sh+1 added-1 removed
307 unmodified lines
308309 [ -d "$NVM_DIR/$VERSION" ] && echo "$VERSION is already installed." && return310311 if [ "$VERSION" = "N/A" ]; then312 echo "Version '$VERSION' not found - try \`nvm ls-remote\` to browse available versions."312 echo "Version '$provided_version' not found - try \`nvm ls-remote\` to browse available versions."313 return 3314 fi315316 # skip binary install if no binary option specified.
312 unmodified lines