38 lines
1.0 KiB
JavaScript
38 lines
1.0 KiB
JavaScript
/**
|
|
* Build Linux release artifacts.
|
|
*
|
|
* AppImage packaging uses Linux tooling (mksquashfs). Running it from
|
|
* Windows PowerShell reaches linux-unpacked, then fails while creating
|
|
* the AppImage. Build from Linux/WSL instead.
|
|
*/
|
|
import { spawnSync } from 'node:child_process';
|
|
import process from 'node:process';
|
|
|
|
function run(command, args) {
|
|
const result = spawnSync(command, args, {
|
|
stdio: 'inherit',
|
|
shell: process.platform === 'win32',
|
|
});
|
|
|
|
if (result.status !== 0) {
|
|
process.exit(result.status ?? 1);
|
|
}
|
|
}
|
|
|
|
if (process.platform === 'win32') {
|
|
console.error(
|
|
[
|
|
'[pack:linux] AppImage нельзя собрать напрямую из Windows PowerShell.',
|
|
'Запустите команду внутри Linux/WSL из папки проекта:',
|
|
'',
|
|
' cd /mnt/d/Work/my_projects/dnd_project/dnd_player',
|
|
' npm ci',
|
|
' npm run pack:linux',
|
|
].join('\n'),
|
|
);
|
|
process.exit(1);
|
|
}
|
|
|
|
run('npm', ['run', 'build']);
|
|
run('electron-builder', ['--linux']);
|