1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-28 03:27:44 +00:00

android-commands.sh: Reformat file with shftm

This commit is contained in:
Joining7943 2023-04-14 19:23:43 +02:00
parent 78ce521c01
commit 037aaf0a36

View file

@ -14,7 +14,6 @@
# success, some other number for errors (an empty file is basically the same as
# 0). Note that the return codes are text, not raw bytes.
this_repo="$(dirname $(dirname -- "$(readlink -- "${0}")"))"
help() {
@ -62,7 +61,10 @@ run_termux_command() {
probe="$2" # unique file that indicates the command is complete
launch_termux
adb shell input text "$command" && hit_enter
while ! adb shell "ls $probe" 2>/dev/null; do echo "waiting for $probe"; sleep 30; done
while ! adb shell "ls $probe" 2>/dev/null; do
echo "waiting for $probe"
sleep 30
done
return_code=$(adb shell "cat $probe")
adb shell "rm $probe"
echo "return code: $return_code"
@ -182,16 +184,34 @@ exit_code=0
if [ $# -eq 1 ]; then
case "$1" in
sync) sync "$this_repo"; exit_code=$?;;
build) build; exit_code=$?;;
tests) tests; exit_code=$?;;
sync)
sync "$this_repo"
exit_code=$?
;;
build)
build
exit_code=$?
;;
tests)
tests
exit_code=$?
;;
*) help ;;
esac
elif [ $# -eq 2 ]; then
case "$1" in
snapshot) snapshot "$2"; exit_code=$?;;
sync) sync "$2"; exit_code=$?;;
*) help; exit 1;;
snapshot)
snapshot "$2"
exit_code=$?
;;
sync)
sync "$2"
exit_code=$?
;;
*)
help
exit 1
;;
esac
else
help