forked from chrismaltby/gb-studio
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathafter-copy.js
27 lines (22 loc) · 798 Bytes
/
after-copy.js
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
const fs = require("fs-extra");
const Path = require("path");
const disallowedFiles = [".DS_Store"];
function fileFilter(src, dest) {
const filename = Path.basename(src);
return disallowedFiles.indexOf(filename) === -1;
}
function afterCopy(buildPath, electronVersion, platform, arch, callback) {
// Called from electronPackagerConfig in package.json
// Copies correct build Tools for architecture
const toolsDir = "/buildTools/" + platform + "-" + arch;
const dataDir = "/appData/";
fs.copy(__dirname + toolsDir, buildPath + toolsDir, { filter: fileFilter })
.then(() => {
return fs.copy(__dirname + dataDir, buildPath + dataDir, {
filter: fileFilter
});
})
.then(() => callback())
.catch(err => callback(err));
}
module.exports = afterCopy;