Skip to content

Commit c2f587f

Browse files
committed
Checkout tools in a .temp folder when not found and decouple them from .bld file support
1 parent ec1be2b commit c2f587f

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

mbed/mbed.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1118,8 +1118,8 @@ def get_tools_dir(self):
11181118
mbed_os_path = self.get_os_dir()
11191119
if mbed_os_path and os.path.isdir(os.path.join(mbed_os_path, 'tools')):
11201120
return os.path.join(mbed_os_path, 'tools')
1121-
elif os.path.isdir(os.path.join(self.path, 'mbed', 'tools')):
1122-
return os.path.join(self.path, 'mbed', 'tools')
1121+
elif os.path.isdir(os.path.join(self.path, '.temp', 'tools')):
1122+
return os.path.join(self.path, '.temp', 'tools')
11231123
else:
11241124
return None
11251125

@@ -1128,10 +1128,10 @@ def post_action(self):
11281128
mbed_tools_path = self.get_tools_dir()
11291129

11301130
if not mbed_tools_path:
1131-
if os.path.isdir(os.path.join(self.path, 'mbed')) and Repo.isrepo(os.path.join(self.path, 'mbed')):
1132-
print 'ole'
1133-
self.get_tools(os.path.join(self.path, 'mbed'))
1134-
mbed_tools_path = self.get_tools_dir()
1131+
if not os.path.exists(os.path.join(self.path, '.temp')):
1132+
os.mkdir(os.path.join(self.path, '.temp'))
1133+
self.get_tools(os.path.join(self.path, '.temp'))
1134+
mbed_tools_path = self.get_tools_dir()
11351135

11361136
if not mbed_tools_path:
11371137
warning("Cannot find the mbed tools directory in \"%s\"" % self.path)
@@ -1168,7 +1168,7 @@ def get_tools(self, path):
11681168
tools_dir = 'tools'
11691169
if not os.path.exists(tools_dir):
11701170
try:
1171-
action("Adding mbed SDK tools in \"%s\"" % os.path.join(path, tools_dir))
1171+
action("Couldn't find build tools in your program. Downloading the mbed SDK tools...")
11721172
Hg.clone(mbed_sdk_tools_url, tools_dir)
11731173
except:
11741174
if os.path.exists(tools_dir):

0 commit comments

Comments
 (0)