Skip to content

Unified tools path finding routine and add support for core/tools #195

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 14, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 14 additions & 9 deletions mbed/mbed.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@


# Application version
ver = '0.7.1'
ver = '0.7.2'

# Default paths to Mercurial and Git
hg_cmd = 'hg'
Expand Down Expand Up @@ -1153,17 +1153,22 @@ def get_mbedlib_dir(self):
# Gets mbed tools dir (unified)
def get_tools_dir(self):
mbed_os_path = self.get_os_dir()
paths = []
# mbed-os dir identified and tools is a sub dir
if mbed_os_path and os.path.isdir(os.path.join(mbed_os_path, 'tools')):
return os.path.join(mbed_os_path, 'tools')
if mbed_os_path:
paths.append([mbed_os_path, 'tools'])
paths.append([mbed_os_path, 'core', 'tools'])
# mbed-os not identified but tools found under cwd/tools
elif os.path.isdir(os.path.join(self.path, 'tools')):
return os.path.join(self.path, 'tools')
paths.append([self.path, 'tools'])
paths.append([self.path, 'core', 'tools'])
# mbed Classic deployed tools
elif os.path.isdir(os.path.join(self.path, '.temp', 'tools')):
return os.path.join(self.path, '.temp', 'tools')
else:
return None
paths.append([self.path, '.temp', 'tools'])

for p in paths:
if os.path.isdir(os.path.join(*p)):
return os.path.join(*p)

return None

# Routines after cloning mbed-os
def post_action(self):
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def read(fname):
setup(
name="mbed-cli",
packages=["mbed"],
version="0.7.1",
version="0.7.2",
url='http://github.com/ARMmbed/mbed-cli',
author='ARM mbed',
author_email='[email protected]',
Expand Down