From 914912b2763dea74cd9eb3e7692e8189cd3741a2 Mon Sep 17 00:00:00 2001 From: Francisco Molina Date: Fri, 13 Nov 2020 12:36:30 +0100 Subject: [PATCH] dist/tools/jlink: add -nogui to version test If multiple debuggers are present when testing for JLinkExe version a GUI will open to select the debugger to attach, so add -nogui when testing for version as well. --- dist/tools/jlink/jlink.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dist/tools/jlink/jlink.sh b/dist/tools/jlink/jlink.sh index 394d41d561..0effdf122e 100755 --- a/dist/tools/jlink/jlink.sh +++ b/dist/tools/jlink/jlink.sh @@ -157,7 +157,9 @@ test_term() { test_version() { JLINK_MINIMUM_VERSION="6.74" - JLINK_VERSION=$(echo q | "$JLINK" 2> /dev/null | grep "^DLL version*" | grep -oP "\d+\.\d+") + # Adding '-nogui 1' will simply return 'Unknown command line option -nogui' + # on older versions, JLINK_VERSION will still be parsed correctly. + JLINK_VERSION=$(echo q | "${JLINK}" -nogui 1 2> /dev/null | grep "^DLL version*" | grep -oP "\d+\.\d+") if [ $? -ne 0 ]; then echo "Error: J-Link appears not to be installed on your PATH"