Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
async initialize() {
if (this.webext) {
return this.webext;
}
const sourceDir = PATH.dirname(this.manifest);
const artifactsDir = PATH.resolve(sourceDir, "../addons");
const info = await WebExtUtil.cmd.build({
sourceDir,
artifactsDir,
overwriteDest: true,
});
this.webext = info;
return this;
}
const createWebExt = (done) => {
if (BRANCH !== BRANCH_BETA && BRANCH !== BRANCH_RELEASE) {
return done();
}
return webExt.cmd.build({
sourceDir: paths.dest,
artifactsDir: dest.buildDir,
overwriteDest: true
}).then((file) => {
fs.renameSync(file.extensionPath, dest.webext);
done();
});
};