2020-08-12 11:18:10 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
# Test the code with shellcheck
|
|
|
|
#
|
|
|
|
# Copyright 2018-2020 FriendlyNeighborhoodShane
|
|
|
|
# Distributed under the terms of the GNU GPL v3
|
|
|
|
|
|
|
|
abort() {
|
2020-12-16 20:19:57 +00:00
|
|
|
echo " ";
|
|
|
|
echo "!!! FATAL ERROR: $1";
|
|
|
|
echo " ";
|
2020-08-12 11:18:10 +00:00
|
|
|
exit 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
workdir="$(pwd)";
|
|
|
|
|
|
|
|
echo " ";
|
|
|
|
echo "-- Minimal MicroG Test Script --";
|
|
|
|
echo "-- The Essentials only MicroG pack --";
|
|
|
|
|
|
|
|
for bin in shellcheck; do
|
2021-06-24 08:43:53 +00:00
|
|
|
command -v "$bin" >/dev/null || abort "No $bin found";
|
2020-08-12 11:18:10 +00:00
|
|
|
done;
|
|
|
|
|
|
|
|
# These tests are only excluded in the command because they're pointless
|
|
|
|
# We don't need to do them and they only cloud the output
|
|
|
|
|
|
|
|
# SC1087: braces for array expansion
|
|
|
|
# False positive from extended regex
|
|
|
|
# Arrays aren't in sh anyway
|
|
|
|
# SC1090: non-constant source
|
2021-07-22 07:50:49 +00:00
|
|
|
# SC1091: not specified as input
|
2020-08-12 11:18:10 +00:00
|
|
|
# SC2034: assigned but not used
|
|
|
|
# SC2154: used but not assigned
|
|
|
|
# All three happen all the time due to sourcing
|
|
|
|
# Can't add directives because it's all dynamic
|
|
|
|
|
|
|
|
echo " ";
|
2021-07-22 08:07:39 +00:00
|
|
|
shellcheck -s sh -e 1087,1090,1091,2034,2154 "$@" -- ./src/META-INF/com/google/android/update-binary ./*.sh ./conf/*.txt ./res/util/*.sh;
|