Skip to content

Commit dfe6fb7

Browse files
committed
Add params to override crates.sh
1 parent a73ada9 commit dfe6fb7

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

ci/run_task.sh

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ usage() {
3030
cat <<EOF
3131
Usage:
3232
33-
./run_task.sh TASK
33+
./run_task.sh TASK [CRATE1] [CRATE2] ...
3434
3535
TASK
3636
- stable Run tests with stable toolchain.
@@ -41,6 +41,11 @@ TASK
4141
- docsrs Build docs with nightly toolchain.
4242
- bench Run the bench tests.
4343
44+
CRATES (optional)
45+
- If provided, run the task only on the specified crate(s).
46+
- Multiple crates can be specified as space-delimited arguments.
47+
- If not provided, run the task on all crates from contrib/crates.sh.
48+
4449
Environment Variables:
4550
MAINTAINER_TOOLS_LOG_LEVEL Control script and cargo output verbosity.
4651
verbose (default) Show all script and cargo messages.
@@ -70,9 +75,16 @@ main() {
7075
fi
7176

7277
verbose_say "Repository: $REPO_DIR"
73-
verbose_say "Script invocation: $0 $task"
78+
verbose_say "Script invocation: $0 $*"
79+
80+
# Shift to remove the task argument, leaving only crate arguments.
81+
shift
7482

75-
if [ -e "$crates_script" ]; then
83+
# Override crates.sh if there are crate args.
84+
if [ "$#" -gt 0 ]; then
85+
CRATES="$*"
86+
verbose_say "Using specified crate(s): $CRATES"
87+
elif [ -e "$crates_script" ]; then
7688
verbose_say "Sourcing $crates_script"
7789
# can't find the file because of the ENV var
7890
# shellcheck source=/dev/null

0 commit comments

Comments
 (0)