]> git.eshelyaron.com Git - emacs.git/commitdiff
* java/debug.sh: Print errors correctly if device is ambiguous.
authorPo Lu <luangruo@yahoo.com>
Sat, 17 Feb 2024 02:33:54 +0000 (10:33 +0800)
committerEshel Yaron <me@eshelyaron.com>
Sat, 17 Feb 2024 13:02:24 +0000 (14:02 +0100)
(cherry picked from commit 537914561eb3809e34b9daf8c2b4719ae9b30a6b)

java/debug.sh

index 8fc03d014cf7ca1d800b3265bcd0d8030233268f..c5d4014135560609878a1be4bfbb85d337ee7179 100755 (executable)
@@ -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"`