Skip to content

Commit fbdf88c

Browse files
committed
Accept ruby configuration flags as extra position arguments on the command line
1 parent f7d63b7 commit fbdf88c

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

bin/rbenv-install

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,9 +221,12 @@ cleanup() {
221221

222222
trap cleanup SIGINT
223223

224+
build_args=(${KEEP:+--keep} ${VERBOSE:+--verbose} ${HAS_PATCH:+--patch} "$DEFINITION" "$PREFIX")
225+
[ ${#EXTRA_ARGUMENTS[@]} -eq 0 ] || build_args+=(-- "${EXTRA_ARGUMENTS[@]}")
226+
224227
# Invoke `ruby-build` and record the exit status in $STATUS.
225228
STATUS=0
226-
ruby-build $KEEP $VERBOSE $HAS_PATCH "$DEFINITION" "$PREFIX" || STATUS="$?"
229+
ruby-build "${build_args[@]}" || STATUS="$?"
227230

228231
# Display a more helpful message if the definition wasn't found.
229232
if [ "$STATUS" == "2" ]; then

bin/ruby-build

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1331,6 +1331,10 @@ if [ "${#ARGUMENTS[@]}" -gt 2 ]; then
13311331
EARLY_EXIT=usage_error
13321332
fi
13331333

1334+
if [ "${#EXTRA_ARGUMENTS[@]}" -gt 0 ]; then
1335+
RUBY_CONFIGURE_OPTS_ARRAY=("${EXTRA_ARGUMENTS[@]}")
1336+
fi
1337+
13341338
case "$EARLY_EXIT" in
13351339
help )
13361340
version

0 commit comments

Comments
 (0)