From 22ca55dbc42e5e45a8bd4fd5fbbb6d5aa16a84ad Mon Sep 17 00:00:00 2001 From: Will Farrington Date: Tue, 26 Mar 2013 17:55:22 -0400 Subject: [PATCH] Properly fail when shims' counterparts are not present, fixes #6 --- libexec/nodenv-exec | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/libexec/nodenv-exec b/libexec/nodenv-exec index f88460a..409546a 100755 --- a/libexec/nodenv-exec +++ b/libexec/nodenv-exec @@ -25,6 +25,12 @@ if [ -z "$NODENV_VERSION" ]; then fi fi +# if the specified NodeJS version lacks this bin, bail +if [ ! -x "$NODENV_ROOT/versions/$NODENV_VERSION/bin/$1" ]; then + echo "nodenv: \`$1' does not exist for $NODENV_VERSION" >&2 + exit 1 +fi + export NODENV_VERSION # Put our bindir onto PATH