From c15cbaa59f6ee9430a3fc43e3c5060931fe6bb11 Mon Sep 17 00:00:00 2001 From: Dylan Laduranty Date: Thu, 13 Jul 2023 16:34:36 +0200 Subject: [PATCH 1/2] dist/tools/usb-serial/list-ttys.sh: call ttys.py with its path Signed-off-by: Dylan Laduranty (cherry picked from commit 3b85c56646fb1674a91c01d8f85b33b5c884f6a4) --- dist/tools/usb-serial/list-ttys.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dist/tools/usb-serial/list-ttys.sh b/dist/tools/usb-serial/list-ttys.sh index 9bd4c0c4925b..6b834b98c3ac 100755 --- a/dist/tools/usb-serial/list-ttys.sh +++ b/dist/tools/usb-serial/list-ttys.sh @@ -3,4 +3,5 @@ # Public License v2.1. See the file LICENSE in the top level directory for more # details. -./ttys.py --format path +SCRIPTDIR="$(cd "$(dirname "$0")" || exit 1; pwd)" +"$SCRIPTDIR"/ttys.py --format path From 6b7e2c3d94ca996222feedb97f4d7f40ddfaa9b1 Mon Sep 17 00:00:00 2001 From: Dylan Laduranty Date: Wed, 12 Jul 2023 00:12:43 +0200 Subject: [PATCH 2/2] dist/tools/usb-serial/find-tty.sh: call ttys.py with its path Signed-off-by: Dylan Laduranty (cherry picked from commit 1007f020eadcf5cc44c97333f3ccfe1762c5dc8c) --- dist/tools/usb-serial/find-tty.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dist/tools/usb-serial/find-tty.sh b/dist/tools/usb-serial/find-tty.sh index 136513d3efb4..5da8470bc6ae 100755 --- a/dist/tools/usb-serial/find-tty.sh +++ b/dist/tools/usb-serial/find-tty.sh @@ -6,8 +6,9 @@ exit_code=1 +SCRIPTDIR="$(cd "$(dirname "$0")" || exit 1; pwd)" for serial in "$@"; do - if ./ttys.py --format path --serial "$serial"; then + if "$SCRIPTDIR"/ttys.py --format path --serial "$serial"; then exit_code=0 fi done