Skip to content

Commit 0a191b9

Browse files
committed
Prevent creation of empty .temp dirs
1 parent 34afc40 commit 0a191b9

File tree

1 file changed

+10
-12
lines changed

1 file changed

+10
-12
lines changed

mbed/mbed.py

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1303,18 +1303,15 @@ def add_tools(self, path):
13031303
error("An error occurred while cloning the mbed SDK tools from \"%s\"" % mbed_sdk_tools_url)
13041304

13051305
def update_tools(self, path):
1306-
if not os.path.exists(path):
1307-
os.mkdir(path)
1308-
with cd(path):
1309-
tools_dir = 'tools'
1310-
if os.path.exists(tools_dir):
1311-
with cd(tools_dir):
1312-
try:
1313-
action("Updating the mbed 2.0 SDK tools...")
1314-
repo = Repo.fromrepo()
1315-
repo.update()
1316-
except Exception:
1317-
error("An error occurred while update the mbed SDK tools from \"%s\"" % mbed_sdk_tools_url)
1306+
tools_dir = 'tools'
1307+
if os.path.exists(os.path.join(path, tools_dir)):
1308+
with cd(os.path.join(path, tools_dir)):
1309+
try:
1310+
action("Updating the mbed 2.0 SDK tools...")
1311+
repo = Repo.fromrepo()
1312+
repo.update()
1313+
except Exception:
1314+
error("An error occurred while update the mbed SDK tools from \"%s\"" % mbed_sdk_tools_url)
13181315

13191316
def get_tools(self):
13201317
mbed_tools_path = self.get_tools_dir()
@@ -1359,6 +1356,7 @@ def get_macros(self):
13591356
macros = f.read().splitlines()
13601357
return macros
13611358

1359+
13621360
def ignore_build_dir(self):
13631361
build_path = os.path.join(self.path, self.build_dir)
13641362
if not os.path.exists(build_path):

0 commit comments

Comments
 (0)