From 2b6fdf327f5d5fede9ff9b9f2307e9cfb528e236 Mon Sep 17 00:00:00 2001 From: Christopher Charbonneau Wells Date: Thu, 11 Oct 2018 19:30:11 -0700 Subject: [PATCH] Add gulp "pre-commit" command. --- gulpfile.js | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/gulpfile.js b/gulpfile.js index 7e414249..2e4b4b1e 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -132,7 +132,21 @@ gulp.task('coverage', coverage); gulp.task('collectstatic', function(cb) { var command = ['run', 'python', 'manage.py', 'collectstatic']; - command = command.concat(process.argv.splice(3)); + + /* Use base settings if no settings parameter is supplied. */ + var parameters = process.argv.splice(3); + var noSettings = true; + for (var i = 0; i < parameters.length; i++) { + if (parameters[i].substring(0, 10) === '--settings') { + noSettings = false; + break; + } + } + if (noSettings) { + parameters.push('--settings=babybuddy.settings.base'); + } + + command = command.concat(parameters); spawn('pipenv', command, { stdio: 'inherit' }).on('exit', cb); }); @@ -179,6 +193,14 @@ function clean() { gulp.task('clean', clean); +gulp.task('pre-commit', gulp.series( + 'lint', + 'test', + 'clean', + 'build', + 'collectstatic' +)); + gulp.task('runserver', function(cb) { var command = ['run', 'python', 'manage.py', 'runserver']; command = command.concat(process.argv.splice(3));