mirror of
https://github.com/bitsocialnet/5chan.git
synced 2026-08-03 07:41:04 +02:00
fix: HTML zip archive is empty in releases
This commit is contained in:
@@ -23,10 +23,13 @@ function createHtmlArchive() {
|
|||||||
const zipBinPath = path.resolve(rootPath, 'node_modules', '7zip-bin', 'linux', 'x64', '7za');
|
const zipBinPath = path.resolve(rootPath, 'node_modules', '7zip-bin', 'linux', 'x64', '7za');
|
||||||
const fivechanHtmlFolderName = `5chan-html-${packageJson.version}`;
|
const fivechanHtmlFolderName = `5chan-html-${packageJson.version}`;
|
||||||
const outputFile = path.resolve(distFolderPath, `${fivechanHtmlFolderName}.zip`);
|
const outputFile = path.resolve(distFolderPath, `${fivechanHtmlFolderName}.zip`);
|
||||||
const inputFolder = path.resolve(rootPath, 'build');
|
// Vite outputs to 'dist', not 'build' (CRA default)
|
||||||
|
const inputFolder = path.resolve(rootPath, 'dist');
|
||||||
try {
|
try {
|
||||||
execSync(`${zipBinPath} a ${outputFile} ${inputFolder}`);
|
// Exclude Electron builder artifacts from HTML archive
|
||||||
execSync(`${zipBinPath} rn -r ${outputFile} build ${fivechanHtmlFolderName}`);
|
const excludes = '-xr!*.AppImage -xr!*.exe -xr!*.dmg -xr!*.blockmap -xr!*.yml -xr!*.yaml -xr!win-unpacked -xr!mac -xr!mac-arm64 -xr!linux-unpacked -xr!builder-*';
|
||||||
|
execSync(`${zipBinPath} a ${outputFile} ${inputFolder} ${excludes}`);
|
||||||
|
execSync(`${zipBinPath} rn -r ${outputFile} dist ${fivechanHtmlFolderName}`);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error('electron build createHtmlArchive error:', e);
|
console.error('electron build createHtmlArchive error:', e);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user