mirror of
https://github.com/pyenv/pyenv.git
synced 2025-11-14 14:23:53 -05:00
Adds error handling to rbenv-sh-shell
This commit is contained in:
@@ -1,2 +1,16 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
echo "export RBENV_VERSION=$1"
|
|
||||||
|
if [ -z "$1" ]; then
|
||||||
|
echo "Please specify one of the following Ruby versions to use:" >&2
|
||||||
|
echo "" >&2
|
||||||
|
echo "$(rbenv-versions)" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
version=$1
|
||||||
|
|
||||||
|
if [ -d "$HOME/.rbenv/versions/$version" ]; then
|
||||||
|
echo "export RBENV_VERSION=$version"
|
||||||
|
else
|
||||||
|
echo "rbenv: version \`$version' is not installed" >&2
|
||||||
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user