mirror of
https://github.com/primedigitaltech/azon_seeker.git
synced 2026-10-05 15:22:59 +08:00
25 lines
693 B
TypeScript
25 lines
693 B
TypeScript
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();
|