Files
FileBow/scripts/build.cjs
T

13 lines
1.2 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
const fs=require('node:fs'),path=require('node:path');
const root=path.resolve(__dirname,'..');
(async()=>{
const {packager}=await import('@electron/packager');
for(const file of ['vendor/engine/FileBowEngine.exe','vendor/windows/FileBow.Windows.exe','vendor/ffmpeg/ffmpeg.exe','licenses/THIRD_PARTY.html'])if(!fs.existsSync(path.join(root,file)))throw new Error(`Build prerequisite missing: ${file}`);
const output=await packager({dir:root,name:'FileBow',executableName:'FileBow',platform:'win32',arch:'x64',electronVersion:'43.7.0',out:path.join(root,'out'),overwrite:true,asar:false,
icon:path.join(root,'assets/icon.ico'),appVersion:require('../package.json').version,
win32metadata:{ProductName:'FileBow',FileDescription:'FileBow – File tools',InternalName:'FileBow',OriginalFilename:'FileBow.exe'},
ignore:[/^\/(?:\.venv|\.git|build|out|test-results|tests|scripts|native|store|engine|node_modules)(?:\/|$)/,/^\/(?:FEATURE_PARITY|VALIDATION)\.md$/i,/\/\.gitignore$/,/default-docx-template(?:\/|$)/,/\.pyc$/,/\.pdb$/,/requirements\./,/pnpm/,/^\/vendor\/native(?:\/|$)/],
prune:true});
console.log(output.join('\n'));
})().catch(error=>{console.error(error);process.exit(1);});