import _7z from '7zip-min'; import { basename } from 'path'; import fs from 'fs-extra'; import { r, log } from './utils'; import packageJson from '../package.json'; const scriptPath = ['extension', 'extension-firefox']; async function main() { for (const src of scriptPath) { const srcPath = r(src); if (!(await fs.pathExists(r(src, 'manifest.json')))) continue; const distPath = r('build', `${basename(src)}-v${packageJson.version}.7z`); try { const output = await _7z.pack(srcPath, distPath); log('Info', `stdout of the 7za command execution ${output}`); } catch (err) { log('Error', `${err}`); process.exitCode = 1; } } } void main();