File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -56,23 +56,26 @@ function main () {
5656 log $GREEN " Building..."
5757
5858 # Pre-build the filtered examples prior to running them.
59- cargo build $( printf -- ' --example %s ' $examples )
59+ cargo build $( printf -- ' --example %s ' $( echo " $ examples" ) )
6060
6161 log $GREEN " Running..."
6262
63- # Run all the examples that are left after filtering.
64- printf ' %s\n ' $examples \
65- | xargs -P4 -I{} bash -c '
66- bin="./target/debug/examples/{}"
63+ printf ' %s\n ' $examples | xargs -P4 -I{} bash -c '
64+ name="$1"
65+ bin="./target/debug/examples/$name"
66+
6767 if [[ -x "$bin" ]]; then
68- "$bin" >/dev/null \
69- && echo "Successfully ran: {}" \
70- || { echo "Failed to run: {}" >&2; exit 1; }
68+ if "$bin" >/dev/null; then
69+ echo "Successfully ran: $name"
70+ else
71+ echo "Failed to run: $name" >&2
72+ exit 1
73+ fi
7174 else
7275 echo "Missing binary: $bin" >&2
7376 exit 1
7477 fi
75- '
78+ ' -- {}
7679
7780 log $GREEN " Done"
7881}
You can’t perform that action at this time.
0 commit comments