Skip to content

Commit 4aeb3be

Browse files
committed
Allow reset and sterm switches for 'mbed detect' even if mbed OS tools are present
1 parent f6c29a7 commit 4aeb3be

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

mbed/mbed.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2749,7 +2749,7 @@ def detect(reset=False, sterm=False):
27492749
with cd(program.path):
27502750
tools_dir = program.get_tools_dir()
27512751

2752-
if tools_dir:
2752+
if tools_dir and not (reset or sterm):
27532753
# Prepare environment variables
27542754
env = program.get_env()
27552755

@@ -2762,7 +2762,9 @@ def detect(reset=False, sterm=False):
27622762
if very_verbose:
27632763
error(str(e))
27642764
else:
2765-
warning("The mbed OS tools were not found in \"%s\". \nLimited information will be shown about connected mbed targets/boards" % program.path)
2765+
if not tools_dir:
2766+
warning("The mbed OS tools were not found in \"%s\". \nLimited information will be shown about connected mbed targets/boards" % program.path)
2767+
27662768
targets = program.get_detected_targets()
27672769
if targets:
27682770
unknown_found = False

0 commit comments

Comments
 (0)