Last active
August 4, 2022 22:01
-
-
Save mcranston18/8a0d23ead646df46f1f4 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var git = require('gulp-git'); | |
var inject = require('inject-string'); | |
// This successfully returns my git hash | |
gulp.task('hash', function() { | |
git.revParse({args:'--short HEAD'}, function (err, hash) { | |
return hash; | |
});) | |
}) | |
// How do I inject the return value of the hash task into the inject.append block? | |
gulp.task('html', function () { | |
return gulp.src('app/index.html') | |
.pipe(inject.append('append git hash here!')) | |
.pipe(gulp.dest('dist')) | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment