mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-28 11:37:44 +00:00
android-commands.sh: Reformat file with shftm
This commit is contained in:
parent
78ce521c01
commit
037aaf0a36
1 changed files with 38 additions and 18 deletions
|
@ -14,7 +14,6 @@
|
||||||
# success, some other number for errors (an empty file is basically the same as
|
# 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.
|
# 0). Note that the return codes are text, not raw bytes.
|
||||||
|
|
||||||
|
|
||||||
this_repo="$(dirname $(dirname -- "$(readlink -- "${0}")"))"
|
this_repo="$(dirname $(dirname -- "$(readlink -- "${0}")"))"
|
||||||
|
|
||||||
help() {
|
help() {
|
||||||
|
@ -62,7 +61,10 @@ run_termux_command() {
|
||||||
probe="$2" # unique file that indicates the command is complete
|
probe="$2" # unique file that indicates the command is complete
|
||||||
launch_termux
|
launch_termux
|
||||||
adb shell input text "$command" && hit_enter
|
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")
|
return_code=$(adb shell "cat $probe")
|
||||||
adb shell "rm $probe"
|
adb shell "rm $probe"
|
||||||
echo "return code: $return_code"
|
echo "return code: $return_code"
|
||||||
|
@ -182,16 +184,34 @@ exit_code=0
|
||||||
|
|
||||||
if [ $# -eq 1 ]; then
|
if [ $# -eq 1 ]; then
|
||||||
case "$1" in
|
case "$1" in
|
||||||
sync) sync "$this_repo"; exit_code=$?;;
|
sync)
|
||||||
build) build; exit_code=$?;;
|
sync "$this_repo"
|
||||||
tests) tests; exit_code=$?;;
|
exit_code=$?
|
||||||
|
;;
|
||||||
|
build)
|
||||||
|
build
|
||||||
|
exit_code=$?
|
||||||
|
;;
|
||||||
|
tests)
|
||||||
|
tests
|
||||||
|
exit_code=$?
|
||||||
|
;;
|
||||||
*) help ;;
|
*) help ;;
|
||||||
esac
|
esac
|
||||||
elif [ $# -eq 2 ]; then
|
elif [ $# -eq 2 ]; then
|
||||||
case "$1" in
|
case "$1" in
|
||||||
snapshot) snapshot "$2"; exit_code=$?;;
|
snapshot)
|
||||||
sync) sync "$2"; exit_code=$?;;
|
snapshot "$2"
|
||||||
*) help; exit 1;;
|
exit_code=$?
|
||||||
|
;;
|
||||||
|
sync)
|
||||||
|
sync "$2"
|
||||||
|
exit_code=$?
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
help
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
esac
|
esac
|
||||||
else
|
else
|
||||||
help
|
help
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue