Skip to content

Commit fdbc0b1

Browse files
committed
Unified tools path finding routine and add support for core/tools
1 parent 66b54bf commit fdbc0b1

File tree

2 files changed

+15
-10
lines changed

2 files changed

+15
-10
lines changed

mbed/mbed.py

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535

3636

3737
# Application version
38-
ver = '0.7.1'
38+
ver = '0.7.2'
3939

4040
# Default paths to Mercurial and Git
4141
hg_cmd = 'hg'
@@ -1153,17 +1153,22 @@ def get_mbedlib_dir(self):
11531153
# Gets mbed tools dir (unified)
11541154
def get_tools_dir(self):
11551155
mbed_os_path = self.get_os_dir()
1156+
paths = []
11561157
# mbed-os dir identified and tools is a sub dir
1157-
if mbed_os_path and os.path.isdir(os.path.join(mbed_os_path, 'tools')):
1158-
return os.path.join(mbed_os_path, 'tools')
1158+
if mbed_os_path:
1159+
paths.append([mbed_os_path, 'tools'])
1160+
paths.append([mbed_os_path, 'core', 'tools'])
11591161
# mbed-os not identified but tools found under cwd/tools
1160-
elif os.path.isdir(os.path.join(self.path, 'tools')):
1161-
return os.path.join(self.path, 'tools')
1162+
paths.append([self.path, 'tools'])
1163+
paths.append([self.path, 'core', 'tools'])
11621164
# mbed Classic deployed tools
1163-
elif os.path.isdir(os.path.join(self.path, '.temp', 'tools')):
1164-
return os.path.join(self.path, '.temp', 'tools')
1165-
else:
1166-
return None
1165+
paths.append([self.path, '.temp', 'tools'])
1166+
1167+
for p in paths:
1168+
if os.path.isdir(os.path.join(*p)):
1169+
return os.path.join(*p)
1170+
1171+
return None
11671172

11681173
# Routines after cloning mbed-os
11691174
def post_action(self):

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ def read(fname):
1919
setup(
2020
name="mbed-cli",
2121
packages=["mbed"],
22-
version="0.7.1",
22+
version="0.7.2",
2323
url='http://github.com/ARMmbed/mbed-cli',
2424
author='ARM mbed',
2525
author_email='[email protected]',

0 commit comments

Comments
 (0)