16 lines
1.1 KiB
JavaScript
16 lines
1.1 KiB
JavaScript
const { spawnSync } = require('node:child_process');
|
|
const path = require('node:path');
|
|
const fs = require('node:fs');
|
|
const root=path.resolve(__dirname,'..');
|
|
const args=['-m','PyInstaller','--noconfirm','--clean','--onedir','--console','--name','FileBowEngine',
|
|
'--distpath','build/engine','--workpath','build/pyinstaller','--specpath','build',
|
|
'--collect-all','pillow_heif','--collect-all','pypdf','--collect-all','fpdf',
|
|
'--hidden-import','PIL.AvifImagePlugin','--hidden-import','PIL.IcoImagePlugin',
|
|
'--exclude-module','tkinter','--exclude-module','pandas','--exclude-module','numpy',
|
|
'--exclude-module','markitdown','--exclude-module','onnxruntime','--exclude-module','magika',
|
|
'--exclude-module','pytest','engine/filebow_engine.py'];
|
|
const result=spawnSync(path.join(root,'.venv/Scripts/python.exe'),args,{cwd:root,stdio:'inherit',windowsHide:true});
|
|
if(result.status!==0)process.exit(result.status||1);
|
|
fs.mkdirSync(path.join(root,'vendor/engine'),{recursive:true});
|
|
fs.cpSync(path.join(root,'build/engine/FileBowEngine'),path.join(root,'vendor/engine'),{recursive:true});
|