Running a shell command from gulp

后端 未结 4 1162
小蘑菇
小蘑菇 2020-12-12 18:03

I would like to run a shell command from gulp, using gulp-shell. I see the following idiom being used the gulpfile.

Is this the idiomatic way to run a c

4条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-12 18:43

    With gulp 4 your tasks can directly return a child process to signal task completion:

    'use strict';
    
    var cp = require('child_process');
    var gulp = require('gulp');
    
    gulp.task('reset', function() {
      return cp.execFile('git checkout -- .');
    });
    

    gulp-v4-running-shell-commands.md

提交回复
热议问题