Commit 7b62fcff by Dan Poggi

Fixes check for user-specified definition

Better to use -f than -e to check for a user-specified definition file.
With -e, if the user accidentally types the name of a directory (or, far
less likely, a device file) with the same name as the Ruby they're
trying to install, they end up with ruby-build doing absolutely nothing
at best, or an error message that could be pretty confusing at worst.
parent a4853d54
......@@ -912,7 +912,7 @@ done
DEFINITION_PATH="${ARGUMENTS[0]}"
if [ -z "$DEFINITION_PATH" ]; then
usage
elif [ ! -e "$DEFINITION_PATH" ]; then
elif [ ! -f "$DEFINITION_PATH" ]; then
BUILTIN_DEFINITION_PATH="${RUBY_BUILD_ROOT}/share/ruby-build/${DEFINITION_PATH}"
if [ -e "$BUILTIN_DEFINITION_PATH" ]; then
DEFINITION_PATH="$BUILTIN_DEFINITION_PATH"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment