Skip to content

Commit 25f8ab1

Browse files
committed
Help find correct tools by searching for make.py (fix for #215)
1 parent 9ca55c8 commit 25f8ab1

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

mbed/mbed.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1155,9 +1155,9 @@ def get_mbedlib_dir(self):
11551155

11561156
# Gets mbed tools dir (unified)
11571157
def get_tools_dir(self):
1158-
mbed_os_path = self.get_os_dir()
11591158
paths = []
11601159
# mbed-os dir identified and tools is a sub dir
1160+
mbed_os_path = self.get_os_dir()
11611161
if mbed_os_path:
11621162
paths.append([mbed_os_path, 'tools'])
11631163
paths.append([mbed_os_path, 'core', 'tools'])
@@ -1167,9 +1167,11 @@ def get_tools_dir(self):
11671167
# mbed Classic deployed tools
11681168
paths.append([self.path, '.temp', 'tools'])
11691169

1170+
fl = 'make.py'
11701171
for p in paths:
1171-
if os.path.isdir(os.path.join(*p)):
1172-
return os.path.join(*p)
1172+
path = os.path.join(*p)
1173+
if os.path.isdir(path) and os.path.isfile(os.path.join(path, fl)):
1174+
return os.path.join(path)
11731175

11741176
return None
11751177

0 commit comments

Comments
 (0)