mirror of
https://github.com/bitsocialnet/5chan.git
synced 2026-08-03 07:41:04 +02:00
chore: convert to esm, add window.plebbitRpcAuthKey, add defaultMediaIpfsGatewayUrl
This commit is contained in:
@@ -1,9 +1,11 @@
|
||||
// hook that runs after electron-build
|
||||
|
||||
const fs = require('fs-extra');
|
||||
const path = require('path');
|
||||
const { execSync } = require('child_process');
|
||||
const rootPath = path.resolve(__dirname, '..');
|
||||
import fs from 'fs-extra';
|
||||
import path from 'path';
|
||||
import { execSync } from 'child_process';
|
||||
import packageJson from '../package.json' assert { type: 'json' };
|
||||
import { fileURLToPath } from 'url';
|
||||
const rootPath = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..');
|
||||
const distFolderPath = path.resolve(rootPath, 'dist');
|
||||
|
||||
const addPortableToPortableExecutableFileName = () => {
|
||||
@@ -21,9 +23,8 @@ const createHtmlArchive = () => {
|
||||
if (process.platform !== 'linux') {
|
||||
return;
|
||||
}
|
||||
const { version } = require('../package.json');
|
||||
const zipBinPath = path.resolve(rootPath, 'node_modules', '7zip-bin', 'linux', 'x64', '7za');
|
||||
const plebchanHtmlFolderName = `plebchan-html-${version}`;
|
||||
const plebchanHtmlFolderName = `plebchan-html-${packageJson.version}`;
|
||||
const outputFile = path.resolve(distFolderPath, `${plebchanHtmlFolderName}.zip`);
|
||||
const inputFolder = path.resolve(rootPath, 'build');
|
||||
try {
|
||||
@@ -37,7 +38,7 @@ const createHtmlArchive = () => {
|
||||
}
|
||||
};
|
||||
|
||||
exports.default = async (buildResult) => {
|
||||
export default async (buildResult) => {
|
||||
addPortableToPortableExecutableFileName();
|
||||
createHtmlArchive();
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user