Created
April 16, 2014 01:53
-
-
Save goliatone/10797365 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
grunt.initConfig({ | |
pkg: grunt.file.readJSON('package.json'), | |
'git-describe': { | |
options: { | |
prop: 'meta.revision' | |
}, | |
me: {} | |
}, | |
... | |
}); | |
grunt.registerTask('tag-revision', 'Tag the current build revision', function () { | |
grunt.task.requires('git-describe'); | |
grunt.file.write('public/version.json', JSON.stringify({ | |
version: grunt.config('pkg.version'), | |
revision: grunt.config('meta.revision'), | |
date: grunt.template.today() | |
})); | |
}); | |
grunt.registerTask('version', ['git-describe', 'tag-revision']); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
grunt-gitinfo
grunt-git-describe