forked from FriendlyNeighborhoodShane/MinMicroG
-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.sh
executable file
·39 lines (31 loc) · 1.04 KB
/
test.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/bin/sh
# Test the code with shellcheck
#
# Copyright 2018-2020 FriendlyNeighborhoodShane
# Distributed under the terms of the GNU GPL v3
abort() {
echo " ";
echo "!!! FATAL ERROR: $1";
echo " ";
exit 1;
}
workdir="$(pwd)";
echo " ";
echo "-- Minimal MicroG Test Script --";
echo "-- The Essentials only MicroG pack --";
for bin in shellcheck; do
command -v "$bin" >/dev/null || abort "No $bin found";
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
# SC1091: not specified as input
# 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 " ";
shellcheck -s sh -e 1087,1090,1091,2034,2154 "$@" -- ./src/META-INF/com/google/android/update-binary ./*.sh ./conf/*.txt ./res/util/*.sh;