Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function installAndRun(installPath, xpiPath) {
// TODO: If the XPI is corrupted, Firefox will crash. Figure out how
// to bail gracefully.
if (file.exists(installPath))
shellUtils.removeDirRecursive(installPath);
shellUtils.makeDir(installPath);
var zip = require("zip-file").open(xpiPath);
zip.extractAll(installPath);
var manifestFile = file.join(installPath, "harness-options.json");
var manifest = JSON.parse(file.read(manifestFile));
return {
id: manifest.jetpackID,
__proto__: require("bootstrap").run(manifest, installPath, print)
};
}
function runTask(options) {
require("bootstrap").run(options, packaging.root.path);
processNextTask();
}