summaryrefslogtreecommitdiffstats
path: root/cppcheck.sh
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2018-11-07 12:19:29 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2018-11-07 12:20:17 +0000
commita64a253794ac64cb40befee54db53bde17dd0d49 (patch)
treec1024acc5f6e508814b944d99f112259bb28b1be /cppcheck.sh
parentNew upstream version 1.10.0+dfsg (diff)
downloadnetdata-a64a253794ac64cb40befee54db53bde17dd0d49.tar.xz
netdata-a64a253794ac64cb40befee54db53bde17dd0d49.zip
New upstream version 1.11.0+dfsgupstream/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 841f01d26..ebbeeaf8f 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} \