Skip to content

Commit

Permalink
take 2: releasebuild works when not within a .git repo
Browse files Browse the repository at this point in the history
  • Loading branch information
davidedc committed Nov 15, 2014
1 parent 33d28c6 commit b578ef2
Showing 1 changed file with 3 additions and 14 deletions.
17 changes: 3 additions & 14 deletions Gruntfile.js
Expand Up @@ -273,7 +273,8 @@ module.exports = function (grunt) {
},
"git-describe": {
"options": {
template: "Current commit: {%=object%}{%=dirty%}"
template: "Current commit: {%=object%}{%=dirty%}",
failOnError: false
},
"your_target": {
// Target-specific file lists and/or options go here.
Expand Down Expand Up @@ -330,19 +331,7 @@ module.exports = function (grunt) {
}));

});
try {
grunt.task.run('git-describe');
}
// if user downloaded the release from github
// using the shiny button instead of cloning,
// like I often do, then git-describe would
// fail, we catch that case here.
catch (err) {
grunt.file.write('dist/version.json', JSON.stringify({
revision: 'no revision given',
date: 'no date given'
}));
}
grunt.task.run('git-describe');
});

grunt.registerTask('releasebuild', [
Expand Down

0 comments on commit b578ef2

Please sign in to comment.