forked from PTCE-Public/popcorn-desktop
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
30 lines (27 loc) · 816 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
var gulp = require('gulp');
var NwBuilder = require('nw-builder');
var os = require('os');
var argv = require('yargs')
.alias('p', 'platforms')
.argv;
var del = require('del');
var detectCurrentPlatform = require('nw-builder/lib/detectCurrentPlatform.js');
var nw = new NwBuilder({
files: ['./src/**', './node_modules/**', './package.json'],
version: '0.12.3',
platforms: argv.p ? argv.p.split(',') : [detectCurrentPlatform()]
}).on('log', console.log);
gulp.task('run', function() {
nw.options.files = './**';
return nw.run().catch(function(error) {
console.error(error);
});
});
gulp.task('build', ['clean'], function() {
return nw.build().catch(function(error) {
console.error(error);
});
});
gulp.task('clean', function() {
return del('build/');
});