grunt-checkbranch
Advanced tools
Comparing version 0.2.1 to 0.2.2
@@ -19,3 +19,3 @@ /* | ||
'tasks/*.js', | ||
'<%= nodeunit.tests %>', | ||
'test/*.js', | ||
], | ||
@@ -38,6 +38,8 @@ options: { | ||
// Unit tests. | ||
nodeunit: { | ||
tests: ['test/*_test.js'], | ||
}, | ||
buster: { | ||
dist: { | ||
} | ||
} | ||
}); | ||
@@ -51,8 +53,8 @@ | ||
grunt.loadNpmTasks('grunt-contrib-clean'); | ||
grunt.loadNpmTasks('grunt-contrib-nodeunit'); | ||
grunt.loadNpmTasks('grunt-release'); | ||
grunt.loadNpmTasks('grunt-buster'); | ||
// Whenever the "test" task is run, first clean the "tmp" dir, then run this | ||
// plugin's task(s), then test the result. | ||
grunt.registerTask('test', ['clean']);// @todo:, 'checkbranch', 'nodeunit']); | ||
grunt.registerTask('test', ['clean', 'buster']); | ||
@@ -59,0 +61,0 @@ // By default, lint and run all tests. |
{ | ||
"name": "grunt-checkbranch", | ||
"description": "Check that we are on a correct Git branch before proceeding.", | ||
"version": "0.2.1", | ||
"version": "0.2.2", | ||
"homepage": "https://github.com/dymonaz/grunt-checkbranch", | ||
@@ -33,6 +33,7 @@ "author": { | ||
"grunt-contrib-jshint": "~0.6.0", | ||
"grunt-contrib-clean": "~0.4.0", | ||
"grunt-contrib-nodeunit": "~0.2.0", | ||
"grunt-contrib-clean": "~0.5.0", | ||
"grunt": "~0.4.1", | ||
"grunt-release": "~0.5.1" | ||
"grunt-release": "~0.5.1", | ||
"buster": "~0.7.6", | ||
"grunt-buster": "~0.2.2" | ||
}, | ||
@@ -43,3 +44,4 @@ "peerDependencies": { | ||
"keywords": [ | ||
"gruntplugin" | ||
"gruntplugin", | ||
"git" | ||
], | ||
@@ -46,0 +48,0 @@ "dependencies": { |
@@ -23,3 +23,3 @@ # grunt-checkbranch | ||
### Overview | ||
Include the task as one of your multitasks, optionally passing the desired branch (default: `master`) after a colon. E.g` | ||
Include the task as one of your multitasks, optionally passing the desired branch (default: `master`) after a colon, e.g.: | ||
```js | ||
@@ -31,5 +31,11 @@ grunt.registerTask("default", ["test", "checkbranch:develop", "deploy"] | ||
You may override this behavior, if `--no-checkbranch` is passed via command line. | ||
You may override this behavior, if `--no-checkbranch` is passed via command line. You can disable `--no-checkbranch` (i.e. force the check) by setting a second param for the task, e.g. `checkbranch:master:true`. | ||
## Release History | ||
_(Nothing yet)_ | ||
### 0.2.2 (2013-09-29) | ||
* Added tests | ||
* Second bool param to force the check. | ||
### 0.2.1 (2013-09-24) | ||
* Initial release (after a few removed, buggy ones) |
@@ -15,5 +15,5 @@ /* | ||
grunt.registerTask('checkbranch', 'Check that we are on a correct Git branch before proceeding.', function (expectedBranch) { | ||
grunt.registerTask('checkbranch', 'Check that we are on a correct Git branch before proceeding.', function (expectedBranch, force) { | ||
if (grunt.option('no-checkbranch')) { | ||
if (grunt.option('no-checkbranch') && !force) { | ||
grunt.log.writeln("Branch check overridden via command line."); | ||
@@ -34,3 +34,3 @@ return; | ||
if (branch !== expectedBranch) { | ||
grunt.fail.fatal("Only '"+expectedBranch+"' branch is allowed, and you're in '" + branch + "' branch."); | ||
grunt.fail.fatal("Only '"+expectedBranch+"' branch is allowed, and you're on '" + branch + "' branch."); | ||
} | ||
@@ -37,0 +37,0 @@ |
8778
10
148
40
6