mirror of
https://github.com/rbenv/ruby-build.git
synced 2025-01-01 14:44:48 +01:00
Allow inline arguments in --if
conditions
Example: install_package openssl-1.1 "https://..." --if needs_openssl:1.0.1-3.1.x In the example, the two values are passed as arguments to the `needs_openssl` function.
This commit is contained in:
parent
b54a73b127
commit
8f294c43ad
1 changed files with 6 additions and 1 deletions
|
@ -197,7 +197,12 @@ install_package_using() {
|
|||
|
||||
for arg in "${@:$(( package_type_nargs + 1 ))}"; do
|
||||
if [ "$last_arg" = "--if" ]; then
|
||||
"$arg" || return 0
|
||||
if [[ $arg == *:* ]]; then
|
||||
# Support colon-separated sub-argument, e.g. `needs_openssl:1.1`
|
||||
"${arg%:*}" "$package_name" "${arg#*:}" || return 0
|
||||
else
|
||||
"$arg" "$package_name" || return 0
|
||||
fi
|
||||
elif [ "$arg" != "--if" ]; then
|
||||
make_args["${#make_args[@]}"]="$arg"
|
||||
fi
|
||||
|
|
Loading…
Reference in a new issue