Skip to content

Can we run git commands inside gulp task #59

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
karthiganesh476 opened this issue May 10, 2021 · 0 comments
Open

Can we run git commands inside gulp task #59

karthiganesh476 opened this issue May 10, 2021 · 0 comments

Comments

@karthiganesh476
Copy link

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

@karthiganesh476 karthiganesh476 changed the title Can we run git commands Can we run git commands inside gulp task May 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant