-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.windows.js
47 lines (42 loc) · 1.27 KB
/
build.windows.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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
var Q = require('q');
var childProcess = require('child_process');
var asar = require('asar');
var jetpack = require('fs-jetpack');
var projectDir;
var buildDir;
var manifest;
var appDir;
function init() {
// Project directory is the root of the application
projectDir = jetpack;
// Build directory is our destination where the final build will be placed
buildDir = projectDir.dir('./dist', { empty: true });
// angular application directory
appDir = projectDir.dir('./build');
// angular application's package.json file
manifest = appDir.read('./package.json', 'json');
return Q();
}
function copyElectron() {
return projectDir.copyAsync('./node_modules/electron/dist', buildDir.path(), { overwrite: true });
}
function cleanupRuntime() {
return buildDir.removeAsync('resources/default_app');
}
function createAsar() {
var deferred = Q.defer();
asar.createPackage(appDir.path(), buildDir.path('resources/app.asar'), function () {
deferred.resolve();
});
return deferred.promise;
}
function build() {
return init()
.then(copyElectron)
.then(cleanupRuntime)
.then(createAsar);
// .then(updateResources)
// .then(rename)
// .then(createInstaller);
}
module.exports = { build: build };