Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
exec(`cd ${common.dist} && zip -r ${zipPath} ./*`, (error, stdout, stderr) => {
if (error) {
console.info('Error : ' + stderr);
resolve();
} else {
signAddon({
xpiPath: zipPath,
version: common.version,
apiKey: common.config.firefox.mozilla.key,
apiSecret: process.env[common.config.firefox.mozilla.secret],
id: common.config.firefox.xpi,
downloadDir: common.pack
})
.then(result => {
if (result.success) {
console.log("Downloaded signed addon");
fs.unlinkSync(zipPath);
const out = common.resolve(outputDir, common.config.dist.replace('{VER}', common.version) + '.xpi');
// Move download file to output dir
if (result.downloadedFiles[0]) {
fs.renameSync(result.downloadedFiles[0], out);
resolve(out);
gulp.task('publish-extension:firefox', ['package'], () => {
return signAddon({
id: 'info@worldbrain.io',
xpiPath: 'dist/extension.zip',
version: JSON.parse(fs.readFileSync('package.json')).version,
apiKey: process.env.AMO_API_KEY,
apiSecret: process.env.AMO_API_SECRET,
channel: 'listed',
downloadDir: 'downloaded_amo',
})
.then(function(result) {
if (result.success) {
console.log('The following signed files were downloaded:')
console.log(result.downloadedFiles)
console.log('Your extension ID is:')
console.log(result.id)
} else {
console.error('Your add-on could not be signed!')
exec(`cd ${common.dist} && zip -r ${zipPath} ./*`, (error, stdout, stderr) => {
if (error) {
console.info('Error : ' + stderr);
resolve();
} else {
signAddon({
xpiPath: zipPath,
version: common.version,
apiKey: AMOUser.key,
apiSecret: AMOUser.secret,
id: common.config.firefox.amo
})
.then(() => {
fs.unlinkSync(zipPath);
resolve();
});
}
});
})
async function publishFF() {
try {
const result = await signAddon({
id: 'info@worldbrain.io',
xpiPath: 'dist/extension.zip',
version: process.env.npm_package_version,
apiKey: process.env.AMO_API_KEY,
apiSecret: process.env.AMO_API_SECRET,
channel: 'listed',
downloadDir: 'downloaded_amo',
})
if (result.success) {
console.log('The following signed files were downloaded:')
console.log(result.downloadedFiles)
console.log('Your extension ID is:')
console.log(result.id)
} else {
console.error('Your add-on could not be signed!')
function sign() {
const manifest = require(DIST_PATH + "manifest.json");
const distFileName = manifest.name + "-" + manifest.version + ".xpi";
signAddon({
xpiPath: OUTPUT_PATH + distFileName,
version: manifest.version,
apiKey: process.env.AMO_API_KEY,
apiSecret: process.env.AMO_API_SECRET,
downloadDir: OUTPUT_PATH,
channel: "listed",
id: "{024f65fd-47e3-4556-bd93-4c0a1d08cd33}"
})
.then(function(result) {
if (result.success) {
console.log("The following signed files were downloaded:");
console.log(result.downloadedFiles);
console.log("Your extension ID is:");
console.log(result.id);
} else {
console.error("Your add-on could not be signed!");