exsvelte/Web/gulpfile.js
2020-11-10 21:44:20 +11:00

25 lines
677 B
JavaScript

(function () {
var SCRIPTS = {
'dev': 'npm run dev',
'dtos': 'npm run dtos',
'build': 'npm run build',
'publish': 'npm run publish'
};
var gulp = require('gulp');
var exec = require('child_process').exec;
function runScript(script, done) {
process.env.FORCE_COLOR = 1;
var proc = exec(script + (script.startsWith("npm") ? " --silent" : ""));
proc.stdout.pipe(process.stdout);
proc.stderr.pipe(process.stderr);
proc.on('exit', () => done());
}
// Tasks
Object.keys(SCRIPTS).forEach(name => {
gulp.task(name, done => runScript(SCRIPTS[name], done));
});
})();