Enable args pass through for other gulp commands.

This is not a perfect solution, but does allow pass through of some command line args.
This commit is contained in:
Christopher Charbonneau Wells 2017-11-09 07:14:06 -05:00
parent 162f117cef
commit 20924eeaec
3 changed files with 17 additions and 60 deletions

View File

@ -10,17 +10,9 @@ var watchConfig = require('../config.js').watchConfig;
gulp.task('lint', ['lint:styles', 'lint:python']);
gulp.task('lint:python', function(cb) {
spawn(
'pipenv',
[
'run',
'flake8',
'--exclude=migrations,manage.py,node_modules,settings'
],
{
stdio: 'inherit'
}
).on('exit', cb);
var command = ['run', 'flake8', '--exclude=migrations,manage.py,node_modules,settings'];
command = command.concat(process.argv.splice(3));
spawn('pipenv', command, { stdio: 'inherit' }).on('exit', cb);
});
gulp.task('lint:styles', function(cb) {

View File

@ -4,18 +4,9 @@ var spawn = require('child_process').spawn;
gulp.task('collectstatic', function(cb) {
spawn(
'pipenv',
[
'run',
'python',
'manage.py',
'collectstatic'
],
{
stdio: 'inherit'
}
).on('exit', cb);
var command = ['run', 'python', 'manage.py', 'collectstatic'];
command = command.concat(process.argv.splice(3));
spawn('pipenv', command, { stdio: 'inherit' }).on('exit', cb);
});
gulp.task('fake', function(cb) {
@ -25,20 +16,12 @@ gulp.task('fake', function(cb) {
});
gulp.task('migrate', function(cb) {
spawn(
'pipenv',
[
'run',
'python',
'manage.py',
'migrate'
],
{
stdio: 'inherit'
}
).on('exit', cb);
var command = ['run', 'python', 'manage.py', 'migrate'];
command = command.concat(process.argv.splice(3));
spawn('pipenv', command, { stdio: 'inherit' }).on('exit', cb);
});
gulp.task('reset', function(cb) {
spawn(
'pipenv',
@ -56,16 +39,7 @@ gulp.task('reset', function(cb) {
});
gulp.task('runserver', function(cb) {
spawn(
'pipenv',
[
'run',
'python',
'manage.py',
'runserver'
],
{
stdio: 'inherit'
}
).on('exit', cb);
});
var command = ['run', 'python', 'manage.py', 'runserver'];
command = command.concat(process.argv.splice(3));
spawn('pipenv', command, { stdio: 'inherit' }).on('exit', cb);
});

View File

@ -4,18 +4,9 @@ var spawn = require('child_process').spawn;
gulp.task('test', function(cb) {
spawn(
'pipenv',
[
'run',
'python',
'manage.py',
'test'
],
{
stdio: 'inherit'
}
).on('exit', cb);
var command = ['run', 'python', 'manage.py', 'test'];
command = command.concat(process.argv.splice(3));
spawn('pipenv', command, { stdio: 'inherit' }).on('exit', cb);
});
gulp.task('coverage', function(cb) {