1.2.0 • Published 6 years ago

gulp-inject-git-rev v1.2.0

Weekly downloads
37
License
Apache-2.0
Repository
github
Last release
6 years ago

gulp-inject-git-rev Build Status Greenkeeper badge

Gulp plugin to inject the git revision number

Usage

Install the plugin:

npm install gulp-inject-git-rev --save

Add the %%GULP.GIT_REV_VERSION%% placeholder to any of your files, e.g.:

<html>
  <head>
    <script>
      window.REV_VERSION = '%%GULP.GIT_REV_VERSION%%';
      console.log(`This is revision ${window.REV_VERSION}.`);
    </script>
  </head>
  <body>
    Hello world from revision %%GULP.GIT_REV_VERSION%%!
  </body>
</html>

Finally, add the plugin to your gulpfile.js:

const injectGitRev = require('gulp-inject-git-rev');

gulp.task('default', ['fetch-git-rev'], function() {
  return gulp.src('src/**/*')
    .pipe(injectGitRev())
    .pipe(gulp.dest('dist'));
}
1.2.0

6 years ago

1.1.2

7 years ago

1.1.1

7 years ago

1.1.0

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago