I need to run a shell command and write the results into a json file:
const Shell = require('gulp-shell');
gulp.task('build-info', () => {
gulp.src('./app/_bundle_info_.json')
.pipe(jeditor((json) => {
var buildNumber = Shell.task([
'git rev-list --count HEAD'
]);
// !!!: I can't get the output of `git rev-list --count HEAD ` via `buildNumber`
json.buildNumber = buildNumber;
return json;
}))
.pipe(gulp.dest("./app"));
});
I use gulp-shell to run the shell command, but I can't get the output from git rev-list --count HEAD
.