summaryrefslogtreecommitdiff
path: root/java
diff options
context:
space:
mode:
authorPo Lu <luangruo@yahoo.com>2024-02-17 10:33:54 +0800
committerPo Lu <luangruo@yahoo.com>2024-02-17 10:33:54 +0800
commit537914561eb3809e34b9daf8c2b4719ae9b30a6b (patch)
treed00db6c4b205864893a676c2627a95c0a9630a04 /java
parent5b65c2ad7526ec081ac37d32c87e9b58e787d66a (diff)
downloademacs-537914561eb3809e34b9daf8c2b4719ae9b30a6b.tar.gz
* java/debug.sh: Print errors correctly if device is ambiguous.
Diffstat (limited to 'java')
-rwxr-xr-xjava/debug.sh13
1 files changed, 8 insertions, 5 deletions
diff --git a/java/debug.sh b/java/debug.sh
index 8fc03d014cf..c5d40141355 100755
--- a/java/debug.sh
+++ b/java/debug.sh
@@ -104,13 +104,14 @@ if [ -z "$devices" ]; then
exit 1
fi
-if [ -z $device ]; then
- device=$devices
+if [ `wc -w <<< "$devices"` -gt 1 ] && [ -z $device ]; then
+ echo "Multiple devices are available. Please specify one with"
+ echo "the option --device and try again."
+ exit 1
fi
-if [ `wc -w <<< "$devices"` -gt 1 ] && [ -z device ]; then
- echo "Multiple devices are available. Please pick one using"
- echo "--device and try again."
+if [ -z $device ]; then
+ device=$devices
fi
echo "Looking for $package on device $device"
@@ -189,6 +190,8 @@ if [ "$attach_existing" != "yes" ]; then
package_pids=`awk -f tmp.awk <<< $package_pids`
fi
+rm tmp.awk
+
pid=$package_pids
num_pids=`wc -w <<< "$package_pids"`