-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
47 lines (34 loc) · 1.13 KB
/
gulpfile.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 gulp = require('gulp')
var gutil = require('gulp-util')
var child_process = require('child_process')
var electronBuilder = require('electron-builder')
function exec(command, options, done) {
var p = child_process.exec(command, options, (error, stderr, stdout) => {
if (error) {
gutil.log(stderr)
return done('Command "' + command + '" Failed')
}
return done()
})
}
gulp.task('pip-install', done => {
return exec('pip install -r requirements.txt', {}, done)
})
gulp.task('cachebrowser-core', ['pip-install'], done => {
return exec('pyinstaller -y ./cachebrowser.spec', {}, done)
})
gulp.task('ui-init', done => {
return exec('npm install', {cwd: 'gui'}, done)
})
gulp.task('ui-build', ['ui-init'], done => {
return exec('gulp build --conf ../env.json', {cwd: 'gui'}, done)
})
gulp.task('ui-bundle', ['ui-build', 'cachebrowser-core'], done => {
var buildConfig = require('./build.json')
electronBuilder.build({
devMetadata: buildConfig
})
.then(() => done())
.catch((error) => done(error))
})
gulp.task('dist', ['cachebrowser-core', 'ui-bundle'])