Skip to content

Commit

Permalink
Cleanup temp file after make (#87)
Browse files Browse the repository at this point in the history
  • Loading branch information
marcelocantos authored Aug 9, 2020
1 parent ccc5b81 commit 33af489
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions scripts/check-coverage.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/bin/sh

set -e

MIN_COVERAGE="$1"

if [ -z "$MIN_COVERAGE" ]; then
Expand All @@ -16,7 +18,12 @@ coverage_level() {
awk '//{sub(/(\.[0-9]+)?%$/,"",$3);print$3}'
}

rm_coverage_file() {
rm $COVERAGE_FILE
}

go test -coverprofile=$COVERAGE_FILE -covermode=atomic ./...
trap rm_coverage_file exit

COVERAGE_LEVEL="$(coverage_level)"
if [ "$COVERAGE_LEVEL" -lt "$MIN_COVERAGE" ]; then
Expand Down

0 comments on commit 33af489

Please sign in to comment.