mirror of
https://github.com/usebruno/bruno.git
synced 2025-08-15 13:02:45 +02:00
feat: refactored about menu + added static path updates for win build
This commit is contained in:
@ -2,6 +2,7 @@ const os = require('os');
|
||||
const fs = require('fs-extra');
|
||||
const util = require('util');
|
||||
const spawn = util.promisify(require('child_process').spawn);
|
||||
const path = require('path');
|
||||
|
||||
async function deleteFileIfExists(filePath) {
|
||||
try {
|
||||
@ -80,7 +81,7 @@ async function main() {
|
||||
// Copy build
|
||||
await copyFolderIfExists('packages/bruno-app/dist', 'packages/bruno-electron/web');
|
||||
|
||||
// Change paths in next
|
||||
// Update static paths
|
||||
const files = await fs.readdir('packages/bruno-electron/web');
|
||||
for (const file of files) {
|
||||
if (file.endsWith('.html')) {
|
||||
@ -90,6 +91,22 @@ async function main() {
|
||||
}
|
||||
}
|
||||
|
||||
// update font load paths
|
||||
const cssDir = path.join('packages/bruno-electron/web/static/css');
|
||||
try {
|
||||
const cssFiles = await fs.readdir(cssDir);
|
||||
for (const file of cssFiles) {
|
||||
if (file.endsWith('.css')) {
|
||||
const filePath = path.join(cssDir, file);
|
||||
let content = await fs.readFile(filePath, 'utf8');
|
||||
content = content.replace(/\/static\/font/g, '../../static/font');
|
||||
await fs.writeFile(filePath, content);
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
console.error(`Error updating font paths: ${error}`);
|
||||
}
|
||||
|
||||
// Remove sourcemaps
|
||||
await removeSourceMapFiles('packages/bruno-electron/web');
|
||||
|
||||
|
Reference in New Issue
Block a user