-
Notifications
You must be signed in to change notification settings - Fork 23
/
Copy pathgulpfile.js
38 lines (31 loc) · 900 Bytes
/
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
var gulp = require('gulp'),
webserver = require('gulp-webserver'),
spawn = require('child_process').spawn,
packager = require('electron-packager'),
electron = require('electron-prebuilt');
var PIPE = {stdio: 'inherit'};
gulp.task('serve:api', function(){
return spawn('python', ['src/api.py'], PIPE);
});
gulp.task('serve:client', function () {
return gulp.src('src').pipe(webserver({open: true}));
});
gulp.task('electron', function () {
return spawn(electron, ['.'], PIPE);
});
gulp.task('build', function (callback) {
var options = {
dir: '.',
name: 'ElectronFlask',
platform: 'all',
arch: 'all',
version: '0.36.2',
out: 'packages',
overwrite: true
};
return packager(options, function done (err, appPath) {
if (err) { return console.log(err); }
callback();
});
});
gulp.task('serve', ['serve:api', 'serve:client']);