File tree Expand file tree Collapse file tree 1 file changed +27
-9
lines changed Expand file tree Collapse file tree 1 file changed +27
-9
lines changed Original file line number Diff line number Diff line change 55# Shellcheck can't search dynamic paths
66# shellcheck source=/dev/null
77
8- set -euox pipefail
8+ set -euo pipefail
99
1010REPO_DIR=$( git rev-parse --show-toplevel)
1111
12- # Make all cargo invocations verbose.
13- export CARGO_TERM_VERBOSE=true
14-
15- # Set to false to turn off verbose output.
16- flag_verbose=true
12+ # Make cargo invocations verbose unless in quiet mode.
13+ # Also control bash debug output based on log level.
14+ case " ${MAINTAINER_TOOLS_LOG_LEVEL:- verbose} " in
15+ quiet)
16+ export CARGO_TERM_VERBOSE=false
17+ export CARGO_TERM_QUIET=true
18+ ;;
19+ * )
20+ export CARGO_TERM_VERBOSE=true
21+ export CARGO_TERM_QUIET=false
22+ set -x
23+ ;;
24+ esac
1725
1826# Use the current `Cargo.lock` file without updating it.
1927cargo=" cargo --locked"
3240 - docs Build docs with stable toolchain.
3341 - docsrs Build docs with nightly toolchain.
3442 - bench Run the bench tests.
43+
44+ Environment Variables:
45+ MAINTAINER_TOOLS_LOG_LEVEL Control script and cargo output verbosity.
46+ verbose (default) Show all script and cargo messages.
47+ quiet Suppress script messages, reduce cargo output.
3548EOF
3649}
3750
@@ -337,9 +350,14 @@ say_err() {
337350}
338351
339352verbose_say () {
340- if [ " $flag_verbose " = true ]; then
341- say " $1 "
342- fi
353+ case " ${MAINTAINER_TOOLS_LOG_LEVEL:- verbose} " in
354+ quiet)
355+ # Suppress verbose output.
356+ ;;
357+ * )
358+ say " $1 "
359+ ;;
360+ esac
343361}
344362
345363err () {
You can’t perform that action at this time.
0 commit comments