keywind/scripts/build.ts

26 lines
527 B
TypeScript
Raw Normal View History

2023-03-10 20:00:00 +00:00
import archiver from 'archiver';
import { createWriteStream, existsSync, mkdirSync } from 'fs';
import { name } from '../package.json';
const dir = 'out';
const file = `${name}.jar`;
const path = `${dir}/${file}`;
!existsSync(dir) && mkdirSync(dir);
const output = createWriteStream(`${__dirname}/../${path}`);
const archive = archiver('zip');
archive.on('error', (error) => {
throw error;
});
archive.pipe(output);
archive.directory('META-INF', 'META-INF');
archive.directory('theme', 'theme');
archive.finalize();