Skip to content

Commit b6ece32

Browse files
check dependencies
1 parent 999a5c2 commit b6ece32

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

scripts/udroid/udroid.sh

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,20 @@ lshout() { echo -e "${_c_blue}-> ${*}${RST}";:;}
1919
imsg() { if [ -n "$UDROID_VERBOSE" ]; then echo -e ": ${*} \e[0m" >&2;fi;:;}
2020
msg() { echo -e "${*} \e[0m" >&2;:;}
2121

22+
_satisfy_deps() {
23+
### Deps
24+
for deb in {proot-distro, proot, tar}; do
25+
if ! command -v $deb >> /dev/null; do
26+
missing_debs="$deb $missing_debs"
27+
fi
28+
done
29+
30+
if [ -n "$missing_debs" ]; then
31+
shout "Trying to install required packages..."
32+
apt install -y $missing_debs
33+
fi
34+
}
35+
2236
_login() {
2337

2438
varient=$1; shift
@@ -237,6 +251,9 @@ if [ ! -d "$D_CACHCE" ]; then
237251
mkdir -p "$D_CACHCE"
238252
fi
239253

254+
# make sure of required packages before any option
255+
_satisfy_deps
256+
240257
while [ $# -gt 0 ]; do
241258
case $1 in
242259
--suite) shift; _SUITE="$1" ;;

0 commit comments

Comments
 (0)