Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/collaborne/gulp-inject-git-rev
Gulp plugin to inject the git revision number
https://github.com/collaborne/gulp-inject-git-rev
Last synced: 6 days ago
JSON representation
Gulp plugin to inject the git revision number
- Host: GitHub
- URL: https://github.com/collaborne/gulp-inject-git-rev
- Owner: Collaborne
- License: apache-2.0
- Created: 2017-08-05T20:46:43.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-11-21T12:58:33.000Z (about 6 years ago)
- Last Synced: 2024-12-06T00:17:07.320Z (23 days ago)
- Language: JavaScript
- Size: 18.6 KB
- Stars: 1
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# gulp-inject-git-rev [![Build Status](https://travis-ci.org/Collaborne/gulp-inject-git-rev.svg?branch=master)](https://travis-ci.org/Collaborne/gulp-inject-git-rev) [![Greenkeeper badge](https://badges.greenkeeper.io/Collaborne/gulp-inject-git-rev.svg)](https://greenkeeper.io/)
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.:
```
window.REV_VERSION = '%%GULP.GIT_REV_VERSION%%';
console.log(`This is revision ${window.REV_VERSION}.`);
Hello world from revision %%GULP.GIT_REV_VERSION%%!
```
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'));
}
```