grunt-checkbranch
Advanced tools
Comparing version 0.3.2 to 0.3.3
@@ -1,9 +0,1 @@ | ||
/* | ||
* grunt-checkbranch | ||
* https://github.com/dymonaz/grunt-checkbranch | ||
* | ||
* Copyright (c) 2013 Dominykas Blyžė | ||
* Licensed under the MIT license. | ||
*/ | ||
'use strict'; | ||
@@ -15,4 +7,4 @@ | ||
grunt.initConfig({ | ||
jshint: { | ||
all: [ | ||
"jshint": { | ||
"all": [ | ||
'Gruntfile.js', | ||
@@ -22,4 +14,4 @@ 'tasks/*.js', | ||
], | ||
options: { | ||
jshintrc: '.jshintrc' | ||
"options": { | ||
"jshintrc": '.jshintrc' | ||
} | ||
@@ -29,10 +21,12 @@ }, | ||
// Before generating any new files, remove any previously-created files. | ||
clean: { | ||
tests: ['tmp'] | ||
"clean": { | ||
"tests": ['tmp'] | ||
}, | ||
// Unit tests. | ||
buster: { | ||
dist: { | ||
reporter: "specification" | ||
"buster": { | ||
"dist": { | ||
"test": { | ||
"reporter": "specification" | ||
} | ||
} | ||
@@ -39,0 +33,0 @@ } |
{ | ||
"name": "grunt-checkbranch", | ||
"description": "Check that we are on a correct Git branch before proceeding.", | ||
"version": "0.3.2", | ||
"version": "0.3.3", | ||
"homepage": "https://github.com/dymonaz/grunt-checkbranch", | ||
@@ -32,8 +32,9 @@ "author": { | ||
"devDependencies": { | ||
"buster": "~0.7.6", | ||
"grunt": "~0.4.1", | ||
"grunt-buster": "~0.3.1", | ||
"grunt-cli": "^0.1.13", | ||
"grunt-contrib-clean": "~0.6.0", | ||
"grunt-contrib-jshint": "~0.11.0", | ||
"grunt-contrib-clean": "~0.6.0", | ||
"grunt": "~0.4.1", | ||
"grunt-release": "~0.12.0", | ||
"buster": "~0.7.6", | ||
"grunt-buster": "~0.3.1" | ||
"grunt-release": "~0.12.0" | ||
}, | ||
@@ -40,0 +41,0 @@ "peerDependencies": { |
@@ -5,3 +5,3 @@ # grunt-checkbranch | ||
[![Build Status](https://travis-ci.org/dymonaz/grunt-checkbranch.svg?branch=master)](https://travis-ci.org/dymonaz/grunt-checkbranch) | ||
[![Build Status](https://travis-ci.org/dominykas/grunt-checkbranch.svg?branch=master)](https://travis-ci.org/dymonaz/grunt-checkbranch) | ||
@@ -39,2 +39,10 @@ ## Getting Started | ||
### 0.3.3 (2015-03-31) | ||
* io.js and 0.12 support | ||
* local grunt-cli | ||
* fix for verbosity | ||
### 0.3.2 (2015-03-24) | ||
* bump deps | ||
### 0.3.1 (2014-05-26) | ||
@@ -41,0 +49,0 @@ * npm update |
@@ -24,3 +24,3 @@ /* | ||
var negate = false; | ||
if(expectedBranch[0] === "!") { | ||
if (expectedBranch[0] === "!") { | ||
negate = true; | ||
@@ -32,17 +32,21 @@ expectedBranch = expectedBranch.slice(1); | ||
var branchOutput = shell.exec("git rev-parse --abbrev-ref HEAD", { silent: !!grunt.option('verbose') }); | ||
if (branchOutput.code !== 0) { | ||
grunt.fail.fatal("Failed to detect the current branch"); | ||
} | ||
var done = this.async(); | ||
shell.exec("git rev-parse --abbrev-ref HEAD", {silent: !grunt.option('verbose')}, function (e, branchOutput) { | ||
if (e) { | ||
grunt.fail.fatal("Failed to detect the current branch"); | ||
} | ||
var branch = branchOutput.output.trim(); | ||
if (!negate && branch !== expectedBranch) { | ||
grunt.fail.fatal("Only '"+expectedBranch+"' branch is allowed, and you're on '" + branch + "' branch."); | ||
} | ||
else if(negate && branch === expectedBranch) { | ||
grunt.fail.fatal("Anything except '"+expectedBranch+"' branch is allowed, and you're on '" + branch + "' branch."); | ||
} | ||
var branch = branchOutput.trim(); | ||
if (!negate && branch !== expectedBranch) { | ||
grunt.fail.fatal("Only '" + expectedBranch + "' branch is allowed, and you're on '" + branch + "' branch."); | ||
} | ||
else if (negate && branch === expectedBranch) { | ||
grunt.fail.fatal("Anything except '" + expectedBranch + "' branch is allowed, and you're on '" + branch + "' branch."); | ||
} | ||
done(); | ||
}); | ||
}); | ||
}; |
@@ -8,6 +8,9 @@ var buster = require('buster'); | ||
var execGrunt = function (cmd) { | ||
var execGrunt = function (gruntCmd) { | ||
shell.pushd('tmp'); | ||
var output = shell.exec("grunt " + cmd); | ||
var execCmd = "grunt --verbose " + gruntCmd; | ||
console.warn("Executing for tests: " + execCmd); | ||
var output = shell.exec(execCmd); | ||
shell.popd(); | ||
console.warn("Done executing for tests: " + execCmd); | ||
return output; | ||
@@ -14,0 +17,0 @@ }; |
Sorry, the diff of this file is not supported yet
10531
169
59
7