mirror of https://github.com/snachodog/mybuddy.git
Add gulp "pre-commit" command.
This commit is contained in:
parent
77bf37df33
commit
2b6fdf327f
24
gulpfile.js
24
gulpfile.js
|
@ -132,7 +132,21 @@ gulp.task('coverage', coverage);
|
||||||
|
|
||||||
gulp.task('collectstatic', function(cb) {
|
gulp.task('collectstatic', function(cb) {
|
||||||
var command = ['run', 'python', 'manage.py', 'collectstatic'];
|
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);
|
spawn('pipenv', command, { stdio: 'inherit' }).on('exit', cb);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -179,6 +193,14 @@ function clean() {
|
||||||
|
|
||||||
gulp.task('clean', clean);
|
gulp.task('clean', clean);
|
||||||
|
|
||||||
|
gulp.task('pre-commit', gulp.series(
|
||||||
|
'lint',
|
||||||
|
'test',
|
||||||
|
'clean',
|
||||||
|
'build',
|
||||||
|
'collectstatic'
|
||||||
|
));
|
||||||
|
|
||||||
gulp.task('runserver', function(cb) {
|
gulp.task('runserver', function(cb) {
|
||||||
var command = ['run', 'python', 'manage.py', 'runserver'];
|
var command = ['run', 'python', 'manage.py', 'runserver'];
|
||||||
command = command.concat(process.argv.splice(3));
|
command = command.concat(process.argv.splice(3));
|
||||||
|
|
Loading…
Reference in New Issue