Skip to content

Instantly share code, notes, and snippets.

View idflood's full-sized avatar

David Mignot idflood

View GitHub Profile
idflood / gulpfile-git-version.js
Created October 25, 2017 06:30 — forked from lukin0110/gulpfile-git-version.js
Gulp git version, fetches the latest git commit hash. Can be used as version for your application. Inject/replace it in your html
'use strict';
var gulp = require('gulp');
var spawn = require('child_process').spawn;
var GIT_VERSION = "na";
gulp.task('version', function(cb){
//git --git-dir=.git log --pretty='%ct %h' -1
//git --git-dir=.git log --pretty='%h' -1