Kalyan
Kalyan

Reputation: 85

Multiple commands in gulp

I want to execute multiple commands using gulp to start a server. I want to execute the following commands with the gulp task.

- cd ../server
- npm run start

I was trying gulp-exec, ... etc and those didn't work.

exec('cd ../server & npm run start')

How to achieve this using the gulp task?

Upvotes: 0

Views: 1127

Answers (1)

Kalyan
Kalyan

Reputation: 85

I was trying with gulp-exec and didn't work.

Later tried this and it worked.

var exec = require('child_process').exec;
gulp.task('start', function(){
    exec('cd ../server && npm run start-windows');
});

Upvotes: 1

Related Questions