1
0
mirror of https://blitiri.com.ar/repos/chasquid synced 2026-01-27 20:45:56 +00:00

Improve bash quoting, and other similar best practices

This patch updates the shell scripts with some of the common best
practices, which should make them more resilient to unusual failures and
unexpected environments (in particular, directories with spaces).

Most of these were identified by shellcheck.
This commit is contained in:
Alberto Bertogli
2022-11-13 00:37:28 +00:00
parent e2481b07a9
commit 948cee1ce1
32 changed files with 133 additions and 126 deletions

View File

@@ -10,7 +10,7 @@
# coverage_test.go), but works for now.
set -e
. $(dirname ${0})/util/lib.sh
. "$(dirname "$0")/util/lib.sh"
init
@@ -28,11 +28,11 @@ export COVER_DIR="$PWD/.coverage"
# tests, which don't expect any expvars to exists besides the one registered
# in the tests themselves.
for pkg in $(go list ./... | grep -v -E 'chasquid/cmd/|chasquid/test'); do
OUT_FILE="$COVER_DIR/pkg-`echo $pkg | sed s+/+_+g`.out"
OUT_FILE="$COVER_DIR/pkg-${pkg//\//_}.out"
go test -tags coverage \
-covermode=count \
-coverprofile="$OUT_FILE" \
-coverpkg=./... $pkg
-coverpkg=./... "$pkg"
done
# Integration tests.
@@ -61,5 +61,5 @@ go run "${UTILDIR}/coverhtml/coverhtml.go" \
echo
echo
echo "Coverage report can be found in:"
echo file://$COVER_DIR/coverage.html
echo "file://$COVER_DIR/coverage.html"