Skip to content

Can we run git commands inside gulp task #59

Description

@karthiganesh476
  • 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');

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions