mirror of
https://gitee.com/dlmu-cone/Arborflow
synced 2026-10-24 02:02:19 +08:00
build: package platform releases
This commit is contained in:
25
scripts/dist-current.cjs
Normal file
25
scripts/dist-current.cjs
Normal file
@@ -0,0 +1,25 @@
|
||||
const { spawnSync } = require('node:child_process');
|
||||
|
||||
const platformTarget = {
|
||||
darwin: 'mac',
|
||||
linux: 'linux',
|
||||
win32: 'win',
|
||||
};
|
||||
|
||||
const target = platformTarget[process.platform];
|
||||
if (!target) {
|
||||
console.error(`Unsupported packaging platform: ${process.platform}`);
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
const npmCommand = process.platform === 'win32' ? 'npm.cmd' : 'npm';
|
||||
const result = spawnSync(npmCommand, ['run', `dist:${target}`], {
|
||||
stdio: 'inherit',
|
||||
});
|
||||
|
||||
if (result.error) {
|
||||
console.error(result.error.message);
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
process.exit(result.status ?? 1);
|
||||
Reference in New Issue
Block a user