🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

grunt-checkbranch

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

grunt-checkbranch

Check that we are on a correct Git branch before proceeding.

0.3.0
Source
npm
Version published
Weekly downloads
14
Maintainers
1
Weekly downloads
 
Created
Source

grunt-checkbranch

Check that we are on a correct Git branch before proceeding.

Getting Started

This plugin requires Grunt ~0.4.1

If you haven't used Grunt before, be sure to check out the Getting Started guide, as it explains how to create a Gruntfile as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:

npm install grunt-checkbranch --save-dev

Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:

grunt.loadNpmTasks('grunt-checkbranch');

The "checkbranch" task

Overview

Include the task as one of your multitasks, optionally passing the desired branch (default: master) after a colon, e.g.:

grunt.registerTask("default", ["test", "checkbranch:develop", "deploy"]

In the example above, the deploy task will only be executed, if your project is currently on the develop branch - otherwise the run will result in a fatal error.

You may override this behavior by passing --no-checkbranch 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.

You may also negate the test, i.e. exclude a specific branch by prepending an exclamation mark, e.g. "checkbranch:!develop".

Release History

0.3.0 (2014-02-24)

  • Added support for negating a branch, i.e. "run everywhere except X" (thx @Pleochism)

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)

Keywords

gruntplugin

FAQs

Package last updated on 24 Feb 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts