mybuddy/gulpfile.js/tasks/manage.js

72 lines
1.3 KiB
JavaScript
Raw Normal View History

var gulp = require('gulp');
var spawn = require('child_process').spawn;
gulp.task('collectstatic', function(cb) {
spawn(
'pipenv',
[
'run',
'python',
'manage.py',
'collectstatic'
],
{
stdio: 'inherit'
}
).on('exit', cb);
});
2017-10-26 16:26:09 +00:00
gulp.task('fake', function(cb) {
var command = ['run', 'python', 'manage.py', 'fake'];
command = command.concat(process.argv.splice(3));
spawn('pipenv', command, { stdio: 'inherit' }).on('exit', cb);
});
gulp.task('migrate', function(cb) {
spawn(
'pipenv',
[
'run',
'python',
'manage.py',
'migrate'
],
{
stdio: 'inherit'
}
).on('exit', cb);
});
gulp.task('reset', function(cb) {
spawn(
'pipenv',
[
'run',
'python',
'manage.py',
'reset',
'--no-input'
],
{
stdio: 'inherit'
}
).on('exit', cb);
});
gulp.task('runserver', function(cb) {
spawn(
'pipenv',
[
'run',
'python',
'manage.py',
'runserver'
],
{
stdio: 'inherit'
}
).on('exit', cb);
});