Skip to content

Commit

Permalink
Support Staged (Pending) Extension Export
Browse files Browse the repository at this point in the history
  • Loading branch information
RealityRipple committed Jan 21, 2021
1 parent 10f1f91 commit b2cf2ef
Show file tree
Hide file tree
Showing 2 changed files with 96 additions and 0 deletions.
64 changes: 64 additions & 0 deletions chrome/content/binding.xml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,38 @@
if (appDir.exists() && appDir.isDirectory())
return appDir.path;
var extStagedFile = Components.classes['@mozilla.org/file/local;1'].createInstance(Components.interfaces.nsILocalFile);
extStagedFile.initWithPath(profPath);
extStagedFile.appendRelativePath('extensions');
extStagedFile.appendRelativePath('staged');
extStagedFile.appendRelativePath(extID + '.xpi');
if (extStagedFile.exists())
return extStagedFile.path;
var extStagedDir = Components.classes['@mozilla.org/file/local;1'].createInstance(Components.interfaces.nsILocalFile);
extStagedDir.initWithPath(profPath);
extStagedDir.appendRelativePath('extensions');
extStagedDir.appendRelativePath('staged');
extStagedDir.appendRelativePath(extID);
if (extStagedDir.exists() && extStagedDir.isDirectory())
return extStagedDir.path;
var appStagedFile = Components.classes['@mozilla.org/file/local;1'].createInstance(Components.interfaces.nsILocalFile);
appStagedFile.initWithPath(appPath);
appStagedFile.appendRelativePath('extensions');
appStagedFile.appendRelativePath('staged');
appStagedFile.appendRelativePath(extID + '.xpi');
if (appStagedFile.exists())
return appStagedFile.path;
var appStagedDir = Components.classes['@mozilla.org/file/local;1'].createInstance(Components.interfaces.nsILocalFile);
appStagedDir.initWithPath(appPath);
appStagedDir.appendRelativePath('extensions');
appStagedDir.appendRelativePath('staged');
appStagedDir.appendRelativePath(extID);
if (appStagedDir.exists() && appStagedDir.isDirectory())
return appStagedDir.path;
return false;
}
function getSave(extName, extVer, sTitle)
Expand Down Expand Up @@ -220,6 +252,38 @@
if (appDir.exists() && appDir.isDirectory())
return appDir.path;
var extStagedFile = Components.classes['@mozilla.org/file/local;1'].createInstance(Components.interfaces.nsILocalFile);
extStagedFile.initWithPath(profPath);
extStagedFile.appendRelativePath('extensions');
extStagedFile.appendRelativePath('staged');
extStagedFile.appendRelativePath(extID + '.xpi');
if (extStagedFile.exists())
return extStagedFile.path;
var extStagedDir = Components.classes['@mozilla.org/file/local;1'].createInstance(Components.interfaces.nsILocalFile);
extStagedDir.initWithPath(profPath);
extStagedDir.appendRelativePath('extensions');
extStagedDir.appendRelativePath('staged');
extStagedDir.appendRelativePath(extID);
if (extStagedDir.exists() && extStagedDir.isDirectory())
return extStagedDir.path;
var appStagedFile = Components.classes['@mozilla.org/file/local;1'].createInstance(Components.interfaces.nsILocalFile);
appStagedFile.initWithPath(appPath);
appStagedFile.appendRelativePath('extensions');
appStagedFile.appendRelativePath('staged');
appStagedFile.appendRelativePath(extID + '.xpi');
if (appStagedFile.exists())
return appStagedFile.path;
var appStagedDir = Components.classes['@mozilla.org/file/local;1'].createInstance(Components.interfaces.nsILocalFile);
appStagedDir.initWithPath(appPath);
appStagedDir.appendRelativePath('extensions');
appStagedDir.appendRelativePath('staged');
appStagedDir.appendRelativePath(extID);
if (appStagedDir.exists() && appStagedDir.isDirectory())
return appStagedDir.path;
return false;
}
function getSave(extName, extVer, sTitle)
Expand Down
32 changes: 32 additions & 0 deletions chrome/content/controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,38 @@ var ExtExp =
if (appDir.exists() && appDir.isDirectory())
return appDir.path;

var extStagedFile = Components.classes['@mozilla.org/file/local;1'].createInstance(Components.interfaces.nsILocalFile);
extStagedFile.initWithPath(profPath);
extStagedFile.appendRelativePath('extensions');
extStagedFile.appendRelativePath('staged');
extStagedFile.appendRelativePath(extID + '.xpi');
if (extStagedFile.exists())
return extStagedFile.path;

var extStagedDir = Components.classes['@mozilla.org/file/local;1'].createInstance(Components.interfaces.nsILocalFile);
extStagedDir.initWithPath(profPath);
extStagedDir.appendRelativePath('extensions');
extStagedDir.appendRelativePath('staged');
extStagedDir.appendRelativePath(extID);
if (extStagedDir.exists() && extStagedDir.isDirectory())
return extStagedDir.path;

var appStagedFile = Components.classes['@mozilla.org/file/local;1'].createInstance(Components.interfaces.nsILocalFile);
appStagedFile.initWithPath(appPath);
appStagedFile.appendRelativePath('extensions');
appStagedFile.appendRelativePath('staged');
appStagedFile.appendRelativePath(extID + '.xpi');
if (appStagedFile.exists())
return appStagedFile.path;

var appStagedDir = Components.classes['@mozilla.org/file/local;1'].createInstance(Components.interfaces.nsILocalFile);
appStagedDir.initWithPath(appPath);
appStagedDir.appendRelativePath('extensions');
appStagedDir.appendRelativePath('staged');
appStagedDir.appendRelativePath(extID);
if (appStagedDir.exists() && appStagedDir.isDirectory())
return appStagedDir.path;

return false;
}
function getSave(extCount, sTitle)
Expand Down

0 comments on commit b2cf2ef

Please sign in to comment.