Skip to content

Commit 78a1edd

Browse files
Merge pull request #4804 from johanstokking/fix/4802-copy-static-files
Copy static files only
2 parents 17d5356 + 382e030 commit 78a1edd

File tree

2 files changed

+12
-8
lines changed

2 files changed

+12
-8
lines changed

tools/export/__init__.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -344,13 +344,14 @@ def export_project(src_paths, export_path, target, ide, libraries_paths=None,
344344
if label not in toolchain.target.features:
345345
resource.add(res)
346346
if isinstance(zip_proj, basestring):
347-
zip_export(join(export_path, zip_proj), name, resource_dict, files,
348-
inc_repos)
347+
zip_export(join(export_path, zip_proj), name, resource_dict,
348+
files + exporter.static_files, inc_repos)
349349
else:
350-
zip_export(zip_proj, name, resource_dict, files, inc_repos)
350+
zip_export(zip_proj, name, resource_dict,
351+
files + exporter.static_files, inc_repos)
351352
else:
352-
for exported in files:
353-
if not exists(join(export_path, basename(exported))):
354-
copyfile(exported, join(export_path, basename(exported)))
353+
for static_file in exporter.static_files:
354+
if not exists(join(export_path, basename(static_file))):
355+
copyfile(static_file, join(export_path, basename(static_file)))
355356

356357
return exporter

tools/export/exporters.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,11 @@ def __init__(self, target, export_dir, project_name, toolchain,
7272
jinja_loader = FileSystemLoader(os.path.dirname(os.path.abspath(__file__)))
7373
self.jinja_environment = Environment(loader=jinja_loader)
7474
self.resources = resources
75-
self.generated_files = [join(self.TEMPLATE_DIR, "GettingStarted.html"),
76-
join(self.TEMPLATE_DIR, ".mbed")]
75+
self.generated_files = []
76+
self.static_files = (
77+
join(self.TEMPLATE_DIR, "GettingStarted.html"),
78+
join(self.TEMPLATE_DIR, ".mbed"),
79+
)
7780
self.builder_files_dict = {}
7881
self.add_config()
7982

0 commit comments

Comments
 (0)