grunt-moreshell

An extension to the Grunt shell task.

npm install grunt-moreshell
6 downloads in the last week
12 downloads in the last month

grunt-moreshell

An extension to the Grunt shell task.

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-moreshell --save-dev

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

grunt.loadNpmTasks('grunt-moreshell');

The "moreshell" task

Overview

In your project's Gruntfile, add a section named moreshell to the data object passed into grunt.initConfig().

grunt.initConfig({
  moreshell:{
    //results in
    //mocha --compilers coffee:coffee-script --reporter Nyan test/test_helper.coffee test/**/*_test.coffee
    mocha: {
        command: {
          name: 'mocha',
          options:{
            compilers: 'coffee:coffee-script',
            reporter: 'Nyan'
          },
          args: ['test/test_helper.coffee','test/**/*_test.coffee']
        },
        options: {
            stdout: true,
            failOnError:true
        }
    }
  },
})

Example Usage

grunt.initConfig({
  moreshell: {
    //mkdir tmp && echo "command_string" > tmp/command_string
    command_string: {
      command: 'mkdir tmp && echo "command_string" > tmp/command_string'
    },
    //grep -H test package.json > tmp/command_object
    command_object: {
      command: {
        name: 'grep',
        options: {
          H: true
        },
        args:'test package.json > tmp/command_object'
      },
      options: {
        prefix: '-',
        stdout: true,
        failOnError:true
      }
    },
  }
}

Config

Command

command.name

Type: String

The shell command to run.

command.options

Type: Object The shell command options hash.

command.args

Type: Array

The shell command arguments.

Options

options.prefix

Default: -- Type: String

The command option flag prefix.

options.separator

Default: ` Type:String`

The command option key value separator.

More...

grunt-shell

Contributing

Try!

npm loves you