Skip to content

Commit 9252b98

Browse files
committed
Correct mbed export with multiple --source params
1 parent 3d1174a commit 9252b98

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

tools/project.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
from __future__ import absolute_import, print_function
55
import sys
66
from os.path import (join, abspath, dirname, exists, basename, normpath,
7-
realpath, basename)
7+
realpath, relpath, basename)
88
from os import remove
99
ROOT = abspath(join(dirname(__file__), ".."))
1010
sys.path.insert(0, ROOT)
@@ -48,7 +48,7 @@ def setup_project(ide, target, program=None, source_dir=None, build=None, export
4848
project_name = TESTS[program]
4949
else:
5050
project_name = basename(normpath(realpath(source_dir[0])))
51-
src_paths = source_dir
51+
src_paths = {relpath(path, project_dir): [path] for path in source_dir}
5252
lib_paths = None
5353
else:
5454
test = Test(program)
@@ -254,7 +254,10 @@ def main():
254254
except (NotImplementedError, IOError, OSError):
255255
pass
256256
for f in EXPORTERS.values()[0].CLEAN_FILES:
257-
remove(f)
257+
try:
258+
remove(f)
259+
except (IOError, OSError):
260+
pass
258261
try:
259262
export(mcu, options.ide, build=options.build,
260263
src=options.source_dir, macros=options.macros,

0 commit comments

Comments
 (0)