Skip to content

Commit fafee88

Browse files
author
Rémi Lauzier
committed
Small script fix (#2591)
# Objective Prevent some possible problem Found by IntelliJ IDEA ## Solution Double quoting variable and exit on possible failure of cd command.
1 parent b13472d commit fafee88

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

tools/example_showcase.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,16 @@
33
duration='2'
44
function wait_seconds() { perl -e 'alarm shift; exec @ARGV' "$@"; }
55
run_example() {
6-
cargo build --example $1
7-
wait_seconds "$duration" cargo run --example $1
6+
cargo build --example "$1"
7+
wait_seconds "$duration" cargo run --example "$1"
88
}
99

1010
example_list="$(cargo build --example 2>&1)"
1111
example_list=${example_list//$'\n'/}
1212
example_list="${example_list#error\: \"--example\" takes one argument.Available examples\: }"
13-
echo $example_list
13+
echo "$example_list"
1414
for example in $example_list
1515
do
1616
echo "Running example: $example"
17-
run_example $example
18-
done
17+
run_example "$example"
18+
done

tools/publish.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,9 @@ cd crates
3737
for crate in "${crates[@]}"
3838
do
3939
echo "Publishing ${crate}"
40-
(cd $crate; cargo publish --no-verify)
40+
(cd "$crate"; cargo publish --no-verify)
4141
sleep 20
4242
done
4343

4444
cd ..
45-
cargo publish
45+
cargo publish

0 commit comments

Comments
 (0)