summaryrefslogtreecommitdiffstats
path: root/cppcheck.sh
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2018-11-07 12:22:44 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2018-11-07 12:22:44 +0000
commit1e6c93250172946eeb38e94a92a1fd12c9d3011e (patch)
tree8ca5e16dfc7ad6b3bf2738ca0a48408a950f8f7e /cppcheck.sh
parentUpdate watch file (diff)
downloadnetdata-1e6c93250172946eeb38e94a92a1fd12c9d3011e.tar.xz
netdata-1e6c93250172946eeb38e94a92a1fd12c9d3011e.zip
Merging upstream version 1.11.0+dfsg.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'cppcheck.sh')
-rwxr-xr-xcppcheck.sh9
1 files changed, 4 insertions, 5 deletions
diff --git a/cppcheck.sh b/cppcheck.sh
index 841f01d2..ebbeeaf8 100755
--- a/cppcheck.sh
+++ b/cppcheck.sh
@@ -2,25 +2,24 @@
# echo >>/tmp/cppcheck.log "cppcheck ${*}"
+# shellcheck disable=SC2230
cppcheck=$(which cppcheck 2>/dev/null || command -v cppcheck 2>/dev/null)
[ -z "${cppcheck}" ] && echo >&2 "install cppcheck." && exit 1
-[ -x "/home/costa/src/cppcheck.git/cppcheck" ] && \
- cppcheck="/home/costa/src/cppcheck.git/cppcheck"
-
processors=$(grep -c ^processor /proc/cpuinfo)
[ $(( processors )) -lt 1 ] && processors=1
base="$(dirname "${0}")"
[ "${base}" = "." ] && base="${PWD}"
-cd "${base}/src" || exit 1
+cd "${base}" || exit 1
[ ! -d "cppcheck-build" ] && mkdir "cppcheck-build"
file="${1}"
shift
-[ "${file}" = "${base}" -o -z "${file}" ] && file="${base}/src"
+# shellcheck disable=SC2235
+([ "${file}" = "${base}" ] || [ -z "${file}" ]) && file="${base}"
"${cppcheck}" \
-j ${processors} \