cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bra...@apache.org
Subject [1/2] git commit: Always use package.crx always as the download target for CRX mode.
Date Tue, 28 Jan 2014 16:45:38 GMT
Updated Branches:
  refs/heads/master 5156ee43a -> dfb369ef5


Always use package.crx always as the download target for CRX mode.

The zip plugin insists on filenames ending in .crx to do its special
handling for CRX files. Since the filename is otherwise irrelevant and
this is really a temporary file, we always use package.crx.


Project: http://git-wip-us.apache.org/repos/asf/cordova-app-harness/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-app-harness/commit/5dc827a0
Tree: http://git-wip-us.apache.org/repos/asf/cordova-app-harness/tree/5dc827a0
Diff: http://git-wip-us.apache.org/repos/asf/cordova-app-harness/diff/5dc827a0

Branch: refs/heads/master
Commit: 5dc827a0d52f0c1d143d469c98af98985e022a11
Parents: 5156ee4
Author: Braden Shepherdson <braden.shepherdson@gmail.com>
Authored: Tue Jan 28 11:20:48 2014 -0500
Committer: Braden Shepherdson <braden.shepherdson@gmail.com>
Committed: Tue Jan 28 11:20:48 2014 -0500

----------------------------------------------------------------------
 www/cdvah/js/CrxInstaller.js | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-app-harness/blob/5dc827a0/www/cdvah/js/CrxInstaller.js
----------------------------------------------------------------------
diff --git a/www/cdvah/js/CrxInstaller.js b/www/cdvah/js/CrxInstaller.js
index f83a3cb..4888699 100644
--- a/www/cdvah/js/CrxInstaller.js
+++ b/www/cdvah/js/CrxInstaller.js
@@ -19,8 +19,9 @@
             var xhr;
             var self = this;
 
-            var baseName = self.url.match(/\/([^\/]*)$/)[1];
-            var crxFile = installPath.replace(/\/$/, '') + '/' + baseName;
+            // The filename doesn't matter, but it needs to end with .crx for the zip plugin
to unpack
+            // it properly. So we always set the filename to package.crx.
+            var crxFile = installPath.replace(/\/$/, '') + '/package.crx';
 
             return ResourcesLoader.downloadFromUrl(this.url, crxFile).then(function(destination)
{
                 return ResourcesLoader.extractZipFile(crxFile, installPath);


Mime
View raw message