-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathforge.config.js
More file actions
53 lines (47 loc) · 1.45 KB
/
Copy pathforge.config.js
File metadata and controls
53 lines (47 loc) · 1.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
import path from 'path';
import fs from 'fs';
const config = {
packagerConfig: {
icon: path.resolve('asset/icon.icns'),
asar: {
unpack: '**/node_modules/{tachyon,chalk,rpxlib,tail,yaml,@foxglove/crc}/**/*'
},
},
rebuildConfig: {},
makers: [
{
name: '@electron-forge/maker-zip',
platforms: ['win32'],
},
{
name: '@rabbitholesyndrome/electron-forge-maker-portable',
config: {
portable: {
artifactName: 'Trailblazer-${version}.exe',
},
},
platforms: ['win32'],
},
],
hooks: {
postMake: async (forgeConfig, makeResults) => {
for (const result of makeResults) {
for (const artifactPath of result.artifacts) {
const platform = result.platform; // win32, linux, darwin
let targetDir = '';
if (platform === 'win32') targetDir = 'windows';
else if (platform === 'linux') targetDir = 'linux';
if (targetDir) {
const destDir = path.join(process.cwd(), 'out', targetDir);
if (!fs.existsSync(destDir)) fs.mkdirSync(destDir, { recursive: true });
const fileName = path.basename(artifactPath);
const destPath = path.join(destDir, fileName);
console.log(`Moving ${fileName} to ${destPath}`);
fs.copyFileSync(artifactPath, destPath);
}
}
}
}
}
};
export default config;