Add shell script linting with shellcheck for better portability

This commit is contained in:
Damien Duportal 2019-05-10 17:24:06 +02:00 committed by Traefiker Bot
parent ab60e702d2
commit 886a6bdbe0
15 changed files with 87 additions and 57 deletions

View file

@ -11,17 +11,17 @@ GREEN=$'\033[32m'
TEXTRESET=$'\033[0m' # reset the foreground colour
# -failfast -timeout=5m
TESTFLAGS="-cover -coverprofile=cover.out ${TESTFLAGS}"
TESTFLAGS=(-cover "-coverprofile=cover.out" "${TESTFLAGS}")
if [ -n "$VERBOSE" ]; then
TESTFLAGS="${TESTFLAGS} -v"
TESTFLAGS+=(-v)
elif [ -n "$VERBOSE_UNIT" ]; then
TESTFLAGS="${TESTFLAGS} -v"
TESTFLAGS+=(-v)
fi
set +e
go test ${TESTFLAGS} ./pkg/...
go test "${TESTFLAGS[@]}" ./pkg/...
CODE=$?
if [ ${CODE} != 0 ]; then