diff options
author | Paweł Krupa <pawel@krupa.net.pl> | 2018-09-12 23:18:19 +0200 |
---|---|---|
committer | Costa Tsaousis <costa@tsaousis.gr> | 2018-09-13 00:18:19 +0300 |
commit | 0426209eadb5ea4a8ad473b811b0366b7c0d8c80 (patch) | |
tree | 906f9ac8e454cd48e073f18389e281f63bae7913 /coverity-scan.sh | |
parent | 98300601b3dd408364afa0fe06ff24e8b3d23d55 (diff) |
[cleanup crusade] linting shell scripts for docker, tests and python (#4162)
* shell linting various scripts
* remove python-modules-installer.sh.in
Diffstat (limited to 'coverity-scan.sh')
-rwxr-xr-x | coverity-scan.sh | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/coverity-scan.sh b/coverity-scan.sh index 107690bc06..d39f9b246a 100755 --- a/coverity-scan.sh +++ b/coverity-scan.sh @@ -1,10 +1,10 @@ #!/usr/bin/env bash -cpus=$(grep ^processor </proc/cpuinfo| wc -l) +cpus=$(grep -c ^processor </proc/cpuinfo) [ -z "${cpus}" ] && cpus=1 token="${COVERITY_SCAN_TOKEN}" -[ -z "${token}" -a -f .coverity-token ] && token="$(<.coverity-token)" +([ -z "${token}" ] && [ -f .coverity-token ]) && token="$(<.coverity-token)" [ -z "${token}" ] && \ echo >&2 "Save the coverity token to .coverity-token or export it as COVERITY_SCAN_TOKEN." && \ exit 1 @@ -12,7 +12,7 @@ token="${COVERITY_SCAN_TOKEN}" # echo >&2 "Coverity token: ${token}" covbuild="$(which cov-build 2>/dev/null || command -v cov-build 2>/dev/null)" -[ -z "${covbuild}" -a -f .coverity-build ] && covbuild="$(<.coverity-build)" +([ -z "${covbuild}" ] && [ -f .coverity-build ]) && covbuild="$(<.coverity-build)" [ -z "${covbuild}" ] && \ echo "Save command the full filename of cov-build in .coverity-build" && \ exit 1 @@ -21,7 +21,7 @@ covbuild="$(which cov-build 2>/dev/null || command -v cov-build 2>/dev/null)" echo "The command ${covbuild} is not executable. Save command the full filename of cov-build in .coverity-build" && \ exit 1 -version="$(cat config.h | grep "^#define PACKAGE_VERSION" | cut -d '"' -f 2)" +version="$(grep "^#define PACKAGE_VERSION" config.h | cut -d '"' -f 2)" echo >&2 "Working on netdata version: ${version}" echo >&2 "Cleaning up old builds..." |