aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2013-05-23 16:31:59 -0700
committerAlon Zakai <alonzakai@gmail.com>2013-05-23 16:31:59 -0700
commitd2ebb6200b9ad0fe4f1376e192382383352f7799 (patch)
tree9b19bf4089df7f38f4cdff0ef32ab0837e3a29cb
parentb90b3ea970f3cc65020730f33ff97c4f2bc2a860 (diff)
handle ./ in file packaging
-rwxr-xr-xtests/runner.py6
-rw-r--r--tools/file_packager.py1
2 files changed, 7 insertions, 0 deletions
diff --git a/tests/runner.py b/tests/runner.py
index 6692feee..1b5666c3 100755
--- a/tests/runner.py
+++ b/tests/runner.py
@@ -11469,6 +11469,12 @@ elif 'browser' in str(sys.argv):
Popen([PYTHON, EMCC, os.path.join(self.get_dir(), 'main.cpp'), '--preload-file', os.path.join(self.get_dir(), 'somefile.txt'), '-o', 'page.html']).communicate()
self.run_browser('page.html', 'You should see |load me right before|.', '/report_result?1')
+ # By ./path
+
+ make_main('somefile.txt')
+ Popen([PYTHON, EMCC, os.path.join(self.get_dir(), 'main.cpp'), '--preload-file', './somefile.txt', '-o', 'page.html']).communicate()
+ self.run_browser('page.html', 'You should see |load me right before|.', '/report_result?1')
+
# Should still work with -o subdir/..
make_main(os.path.join(self.get_dir(), 'somefile.txt'))
diff --git a/tools/file_packager.py b/tools/file_packager.py
index 17398a35..22216321 100644
--- a/tools/file_packager.py
+++ b/tools/file_packager.py
@@ -159,6 +159,7 @@ for file_ in data_files:
data_files = filter(lambda file_: not os.path.isdir(file_['name']), data_files)
for file_ in data_files:
+ if file_['name'].startswith('./'): file_['name'] = file_['name'][2:] # remove redundant ./ prefix
file_['name'] = file_['name'].replace(os.path.sep, '/') # name in the filesystem, native and emulated
file_['localname'] = file_['name'] # name to actually load from local filesystem, after transformations