调整打包脚本使用 packaging 资源路径
This commit is contained in:
+4
-4
@@ -165,7 +165,7 @@ if (fs.existsSync(sourceQrcode)) {
|
||||
// ========== 3. 复制 LOGO 图片 ==========
|
||||
const logoDirs = [
|
||||
{ src: 'public', file: 'logo.svg' },
|
||||
{ src: 'electron/resources/build', file: 'logo.png' },
|
||||
{ src: 'packaging/build-resources', file: 'logo.png' },
|
||||
];
|
||||
const sourceLogo = oemConfig.logoPath ? path.join(__dirname, oemConfig.logoPath) : null;
|
||||
if (sourceLogo && fs.existsSync(sourceLogo)) {
|
||||
@@ -174,10 +174,10 @@ if (sourceLogo && fs.existsSync(sourceLogo)) {
|
||||
fs.copyFileSync(sourceLogo, path.join(publicDir, 'logo.png'));
|
||||
console.log('[OK] Copied logo.png to public/');
|
||||
}
|
||||
const buildDir = path.join(__dirname, 'electron/resources/build');
|
||||
const buildDir = path.join(__dirname, 'packaging/build-resources');
|
||||
if (fs.existsSync(buildDir)) {
|
||||
fs.copyFileSync(sourceLogo, path.join(buildDir, 'logo.png'));
|
||||
console.log('[OK] Copied logo.png to electron/resources/build/');
|
||||
console.log('[OK] Copied logo.png to packaging/build-resources/');
|
||||
}
|
||||
const allPublicDirs = fs.readdirSync(__dirname).filter(d => {
|
||||
const sub = path.join(__dirname, d, 'public');
|
||||
@@ -195,7 +195,7 @@ if (sourceLogo && fs.existsSync(sourceLogo)) {
|
||||
// ========== 3.5 复制图标(ICO/ICNS) ==========
|
||||
const sourceIcon = oemConfig.iconPath ? path.join(__dirname, oemConfig.iconPath) : null;
|
||||
if (sourceIcon && fs.existsSync(sourceIcon)) {
|
||||
const buildDir = path.join(__dirname, 'electron/resources/build');
|
||||
const buildDir = path.join(__dirname, 'packaging/build-resources');
|
||||
if (fs.existsSync(buildDir)) {
|
||||
const sharp = require('sharp');
|
||||
const iconBuf = fs.readFileSync(sourceIcon);
|
||||
|
||||
Reference in New Issue
Block a user