Skip to content
Snippets Groups Projects
Commit aa9e5515 authored by Nick Mathewson's avatar Nick Mathewson :game_die:
Browse files

with_coverage: resolve a shellcheck warning

Shellcheck doesn't like it when you do `rm -r "$A/$B"` : it worries
that the path might accidentally expand to /.

That shouldn't actually be possible in this case, but let's avoid
being the people who accidentally remove somebody's filesystem.
parent 5b6b0d6a
No related branches found
No related tags found
No related merge requests found
......@@ -88,8 +88,10 @@ export RUSTFLAGS="-Z instrument-coverage"
export LLVM_PROFILE_FILE=$COVERAGE_BASEDIR/coverage_meta/%p-%m.profraw
export RUSTUP_TOOLCHAIN="${RUST_COVERAGE_TOOLCHAIN}"
if [ -d "$COVERAGE_BASEDIR/$output" ]; then
rm -r "$COVERAGE_BASEDIR/$output" || true
# Using :? here to ensure that the script exits the path would
# otherwise be /
if [ -d "${COVERAGE_BASEDIR:?}/${output:?}" ]; then
rm -r "${COVERAGE_BASEDIR:?}/${output:?}" || true
fi
if [ -d "$COVERAGE_BASEDIR/coverage_meta" ] && [ "$remove_data" = "yes" ]; then
echo "Removing data from previous runs. (Use -c to suppress this behavior.)"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment