diff options
| author | Po Lu | 2024-02-17 10:33:54 +0800 |
|---|---|---|
| committer | Po Lu | 2024-02-17 10:33:54 +0800 |
| commit | 537914561eb3809e34b9daf8c2b4719ae9b30a6b (patch) | |
| tree | d00db6c4b205864893a676c2627a95c0a9630a04 /java | |
| parent | 5b65c2ad7526ec081ac37d32c87e9b58e787d66a (diff) | |
| download | emacs-537914561eb3809e34b9daf8c2b4719ae9b30a6b.tar.gz emacs-537914561eb3809e34b9daf8c2b4719ae9b30a6b.zip | |
* java/debug.sh: Print errors correctly if device is ambiguous.
Diffstat (limited to 'java')
| -rwxr-xr-x | java/debug.sh | 13 |
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 | |||
| 104 | exit 1 | 104 | exit 1 |
| 105 | fi | 105 | fi |
| 106 | 106 | ||
| 107 | if [ -z $device ]; then | 107 | if [ `wc -w <<< "$devices"` -gt 1 ] && [ -z $device ]; then |
| 108 | device=$devices | 108 | echo "Multiple devices are available. Please specify one with" |
| 109 | echo "the option --device and try again." | ||
| 110 | exit 1 | ||
| 109 | fi | 111 | fi |
| 110 | 112 | ||
| 111 | if [ `wc -w <<< "$devices"` -gt 1 ] && [ -z device ]; then | 113 | if [ -z $device ]; then |
| 112 | echo "Multiple devices are available. Please pick one using" | 114 | device=$devices |
| 113 | echo "--device and try again." | ||
| 114 | fi | 115 | fi |
| 115 | 116 | ||
| 116 | echo "Looking for $package on device $device" | 117 | echo "Looking for $package on device $device" |
| @@ -189,6 +190,8 @@ if [ "$attach_existing" != "yes" ]; then | |||
| 189 | package_pids=`awk -f tmp.awk <<< $package_pids` | 190 | package_pids=`awk -f tmp.awk <<< $package_pids` |
| 190 | fi | 191 | fi |
| 191 | 192 | ||
| 193 | rm tmp.awk | ||
| 194 | |||
| 192 | pid=$package_pids | 195 | pid=$package_pids |
| 193 | num_pids=`wc -w <<< "$package_pids"` | 196 | num_pids=`wc -w <<< "$package_pids"` |
| 194 | 197 | ||