summaryrefslogtreecommitdiffstats
path: root/cppcheck.sh
diff options
context:
space:
mode:
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} \