@@ -30,7 +30,7 @@ usage() {
3030 cat << EOF
3131Usage:
3232
33- ./run_task.sh TASK
33+ ./run_task.sh TASK [CRATE]
3434
3535TASK
3636 - stable Run tests with stable toolchain.
4141 - docsrs Build docs with nightly toolchain.
4242 - bench Run the bench tests.
4343
44+ CRATE (optional)
45+ - If provided, run the task only on the specified crate.
46+ - If not provided, run the task on all crates from contrib/crates.sh.
47+
4448Environment Variables:
4549 MAINTAINER_TOOLS_LOG_LEVEL Control script and cargo output verbosity.
4650 verbose (default) Show all script and cargo messages.
5054
5155main () {
5256 local task=" ${1:- usage} "
57+ local single_crate=" ${2:- } "
5358 local crates_script=" $REPO_DIR /contrib/crates.sh"
5459
5560 # FIXME: This is a hackish way to get the help flag.
@@ -70,9 +75,13 @@ main() {
7075 fi
7176
7277 verbose_say " Repository: $REPO_DIR "
73- verbose_say " Script invocation: $0 $task "
78+ verbose_say " Script invocation: $0 $task $single_crate "
7479
75- if [ -e " $crates_script " ]; then
80+ # Override crates.sh if there is a crate arg.
81+ if [ -n " $single_crate " ]; then
82+ verbose_say " Using single crate: $single_crate "
83+ CRATES=" $single_crate "
84+ elif [ -e " $crates_script " ]; then
7685 verbose_say " Sourcing $crates_script "
7786 # can't find the file because of the ENV var
7887 # shellcheck source=/dev/null
0 commit comments