aboutsummaryrefslogtreecommitdiffstats
path: root/grunt.js
diff options
context:
space:
mode:
authorJörn Zaefferer <joern.zaefferer@gmail.com>2012-06-18 19:25:24 +0200
committerJörn Zaefferer <joern.zaefferer@gmail.com>2012-06-18 19:25:37 +0200
commitab542c11cafd494e15bd84df3958a5e8876f02fe (patch)
treeeddb1ddc45d49fd1c281688fb9d4f880b3c53728 /grunt.js
parent80295ed0e54f30ce91d652920454c61c9dd06a09 (diff)
downloadjquery-ab542c11cafd494e15bd84df3958a5e8876f02fe.tar.gz
jquery-ab542c11cafd494e15bd84df3958a5e8876f02fe.zip
Grunt: Include commit in header if passed as ENV arg, mostly for Jenkins
Diffstat (limited to 'grunt.js')
-rw-r--r--grunt.js8
1 files changed, 6 insertions, 2 deletions
diff --git a/grunt.js b/grunt.js
index 4493e083f..ddd81becf 100644
--- a/grunt.js
+++ b/grunt.js
@@ -5,7 +5,7 @@
*
*/
-/*global config:true, task:true*/
+/*global config:true, task:true, process:true*/
module.exports = function( grunt ) {
// readOptionalJSON
@@ -228,6 +228,7 @@ module.exports = function( grunt ) {
optIn = !modules["*"],
name = this.file.dest,
excluded = {},
+ version = config( "pkg.version" ),
excluder = function( flag, needsFlag ) {
// explicit > implicit, so set this first and let it be overridden by explicit
if ( optIn && !modules[ flag ] && !modules[ "+" + flag ] ) {
@@ -243,6 +244,9 @@ module.exports = function( grunt ) {
}
};
+ if ( process.env.COMMIT ) {
+ version += " " + process.env.COMMIT;
+ }
// figure out which files to exclude based on these rules in this order:
// explicit > implicit (explicit also means a dependency/dependent that was explicit)
@@ -312,7 +316,7 @@ module.exports = function( grunt ) {
// Embed Date
// Embed Version
compiled = compiled.replace( "@DATE", new Date() )
- .replace( "@VERSION", config("pkg.version") );
+ .replace( "@VERSION", version );
// Write concatenated source to file
file.write( name, compiled );