Skip to content

Commit

Permalink
Support ruby-build ruby-X.Y.Z DIR
Browse files Browse the repository at this point in the history
* By searching a X.Y.Z definition if no ruby-X.Y.Z definition is not found.
  • Loading branch information
eregon committed Sep 23, 2024
1 parent ed384c8 commit 49dd050
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions bin/ruby-build
Original file line number Diff line number Diff line change
Expand Up @@ -1456,6 +1456,17 @@ if [ ! -f "$DEFINITION_PATH" ]; then
fi
done

# If the given definition is like ruby-X.Y.Z, search again with X.Y.Z
if [[ "$DEFINITION_PATH" =~ ^ruby-[0-9] ]]; then
DEFINITION_PATH="${DEFINITION_PATH#ruby-}"
for DEFINITION_DIR in "${RUBY_BUILD_DEFINITIONS[@]}"; do
if [ -f "${DEFINITION_DIR}/${DEFINITION_PATH}" ]; then
DEFINITION_PATH="${DEFINITION_DIR}/${DEFINITION_PATH}"
break
fi
done
fi

if [ ! -f "$DEFINITION_PATH" ]; then
echo "ruby-build: definition not found: ${DEFINITION_PATH}" >&2
exit 2
Expand Down

0 comments on commit 49dd050

Please sign in to comment.