Fix postinstall script for server builds

This commit is contained in:
Hakan Shehu
2025-01-19 23:40:58 +01:00
parent 7f5bd66937
commit 9de5f06887
2 changed files with 52 additions and 54 deletions

View File

@@ -2,41 +2,33 @@ import path from 'path';
import fs from 'fs';
const copyEmojisDb = () => {
const sourceEmojisDbPath = path.resolve(
'scripts',
'src',
'emojis',
'emojis.db'
);
if (!fs.existsSync(sourceEmojisDbPath)) {
const sourcePath = path.resolve('scripts', 'src', 'emojis', 'emojis.db');
if (!fs.existsSync(sourcePath)) {
return;
}
const targetEmojisDbPath = path.resolve(
'apps',
'desktop',
'assets',
'emojis.db'
);
const targetDir = path.resolve('apps', 'desktop', 'assets');
if (!fs.existsSync(targetDir)) {
return;
}
fs.copyFileSync(sourceEmojisDbPath, targetEmojisDbPath);
const targetPath = path.resolve(targetDir, 'emojis.db');
fs.copyFileSync(sourcePath, targetPath);
};
const copyIconsDb = () => {
const sourceIconsDbPath = path.resolve('scripts', 'src', 'icons', 'icons.db');
if (!fs.existsSync(sourceIconsDbPath)) {
const sourcePath = path.resolve('scripts', 'src', 'icons', 'icons.db');
if (!fs.existsSync(sourcePath)) {
return;
}
const targetIconsDbPath = path.resolve(
'apps',
'desktop',
'assets',
'icons.db'
);
const targetDir = path.resolve('apps', 'desktop', 'assets');
if (!fs.existsSync(targetDir)) {
return;
}
fs.copyFileSync(sourceIconsDbPath, targetIconsDbPath);
const targetPath = path.resolve(targetDir, 'icons.db');
fs.copyFileSync(sourcePath, targetPath);
};
const execute = () => {