Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix multiple CI arches in matrix #3702

Merged
merged 1 commit into from
Feb 6, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions ci/util/extract_switches.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,21 +21,21 @@ switches=()
for arg in "$@"; do
case "$arg" in
--help | -h)
cat <<-EOF | cut -c 5-
cat <<"EOF" | cut -c 5-
Usage: extract_switches.sh <switch> [<switch> ...] -- <argv>

Sorts any recognized switches in argv to the front and returns the result.
Unrecognized switches are left in place.

Example Usage:
new_args=\$(extract_switches.sh -cpu-only -gpu-only
eval set -- \${new_args}
new_args=$(extract_switches.sh -cpu-only -gpu-only -- "$@")
eval set -- ${new_args}
while true; do
case "\$1" in
case "$1" in
-cpu-only) CPU_ONLY=true; shift;;
-gpu-only) GPU_ONLY=true; shift;;
--) shift; break;;
*) echo "Unknown argument: \$1"; exit 1;;
*) echo "Unknown argument: $1"; exit 1;;
esac
done
EOF
Expand All @@ -57,11 +57,11 @@ other_args=()
for arg in "$@"; do
for switch in "${switches[@]}"; do
if [ "$arg" = "$switch" ]; then
found_switches+=("$arg")
found_switches+=("\"$arg\"")
continue 2
fi
done
other_args+=("$arg")
other_args+=("\"$arg\"")
done

echo "${found_switches[@]} -- ${other_args[@]}"
Loading