gulp-run
gulp-run copied to clipboard
Can we run git commands inside gulp task
- I want to run a command inside gulp task as npm install inside the gulp task
- So, I used like run.Command('npm install')
- But the command is not working
- Can anyone help me
- I am new to both npm and gulp
const gulp = require('gulp');
const simpleGit = require('simple-git');
var argument=require('yargs').argv;
var run = require('gulp-run');
var build = require('gulp-build');
var process=require ('process');
gulp.task('work',async function(done){
const git = simpleGit();
await git.clone('https://gitlab.syncfusion.com/bold-reports/javascript-samples.git', 'new', {'--branch':'hotfix/boldreports_v3.1.31'},(err,res) =>
{
if(err)
{
console.log(err);
}
else
{
res="Cloned";
console.log(res);
}
});
await git.cwd(process.cwd()+'/'+"new");
await git.pull((err,res) =>
{
if(err)
{
console.log(err);
}
else
{
res="Success"
console.log(res);
}
}
);
done()
},run.Command('npm install'),'build');