diff options
author | Alon Zakai <alonzakai@gmail.com> | 2014-01-23 17:52:57 -0800 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2014-01-23 17:52:57 -0800 |
commit | c99a28dedf06cd1114f0b4f782b2e1e1d6c10051 (patch) | |
tree | 3932b2651304d777a3170dcf259ed73e2d8deded /tools | |
parent | 91de0c9e7848d370d3113592c6d22b5b22c4ef09 (diff) |
allow adding a custom prefix to file package downloads, so they can happen from a different url; fixes #2049
Diffstat (limited to 'tools')
-rw-r--r-- | tools/file_packager.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/tools/file_packager.py b/tools/file_packager.py index 8b65b219..6c60db58 100644 --- a/tools/file_packager.py +++ b/tools/file_packager.py @@ -462,7 +462,7 @@ if has_preloaded: package_uuid = uuid.uuid4(); remote_package_name = os.path.basename(Compression.compressed_name(data_target) if Compression.on else data_target) - code += r''' + ret += r''' var PACKAGE_PATH; if (typeof window === 'object') { PACKAGE_PATH = window['encodeURIComponent'](window.location.pathname.toString().substring(0, window.location.pathname.toString().lastIndexOf('/')) + '/'); @@ -471,7 +471,7 @@ if has_preloaded: PACKAGE_PATH = encodeURIComponent(location.pathname.toString().substring(0, location.pathname.toString().lastIndexOf('/')) + '/'); } var PACKAGE_NAME = '%s'; - var REMOTE_PACKAGE_NAME = '%s'; + var REMOTE_PACKAGE_NAME = (Module['filePackageURL'] || '') + '%s'; var PACKAGE_UUID = '%s'; ''' % (data_target, remote_package_name, package_uuid) @@ -666,7 +666,7 @@ if has_preloaded: # Only tricky bit is the fetch is async, but also when runWithFS is called is async, so we handle both orderings. ret += r''' var fetched = null, fetchedCallback = null; - fetchRemotePackage('%s', function(data) { + fetchRemotePackage(REMOTE_PACKAGE_NAME, function(data) { if (fetchedCallback) { fetchedCallback(data); fetchedCallback = null; @@ -674,7 +674,7 @@ if has_preloaded: fetched = data; } }, handleError); - ''' % os.path.basename(Compression.compressed_name(data_target) if Compression.on else data_target) + ''' code += r''' Module.preloadResults[PACKAGE_NAME] = {fromCache: false}; |