Skip to content

Commit f28588c

Browse files
committed
Merge pull request #8 from mjs-arm/botch-fixing
Fix merge of support for --source for exporters
2 parents 0b59348 + 810ecc5 commit f28588c

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

tools/export/__init__.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ def online_build_url_resolver(url):
5555

5656

5757
def export(project_path, project_name, ide, target, destination='/tmp/',
58-
tempdir=None, clean=True, extra_symbols=None, build_url_resolver=online_build_url_resolver):
58+
tempdir=None, clean=True, extra_symbols=None, zip=True, build_url_resolver=online_build_url_resolver):
5959
# Convention: we are using capitals for toolchain and target names
6060
if target is not None:
6161
target = target.upper()
@@ -131,8 +131,13 @@ def export(project_path, project_name, ide, target, destination='/tmp/',
131131
# add readme file to every offline export.
132132
open(os.path.join(tempdir, 'GettingStarted.htm'),'w').write('<meta http-equiv="refresh" content="0; url=http://mbed.org/handbook/Getting-Started-mbed-Exporters#%s"/>'% (ide))
133133
# copy .hgignore file to exported direcotry as well.
134-
copy(os.path.join(exporter.TEMPLATE_DIR,'.hgignore'),tempdir)
135-
zip_path = zip_working_directory_and_clean_up(tempdir, destination, project_name, clean)
134+
if exists(os.path.join(exporter.TEMPLATE_DIR,'.hgignore')):
135+
copy(os.path.join(exporter.TEMPLATE_DIR,'.hgignore'),tempdir)
136+
137+
if zip:
138+
zip_path = zip_working_directory_and_clean_up(tempdir, destination, project_name, clean)
139+
else:
140+
zip_path = destination
136141

137142
return zip_path, report
138143

0 commit comments

Comments
 (0)