UNPKG

519 BJavaScriptView Raw
1
2'use strict';
3
4var
5 cp = require('child_process'),
6 path = require('path'),
7 argv = process.argv.slice(2).join(' '),
8 str = `--dir ${path.dirname(process.argv[1])} ${argv}`,
9 child;
10
11
12module.exports = function() {
13
14 child = cp.exec('gulp ' + str, { cwd: __dirname }, function(err, stdout, stderr) {
15
16 if (err !== null)
17 throw err;
18
19 });
20
21 child.stdout.on('data', function(data) {
22 console.log(data);
23 });
24
25 child.stderr.on('data', function(data) {
26 console.log(data);
27 });
28
29}