grunt-moreshell

An extension to the Grunt shell task.

grunt-moreshell

An extension to the Grunt shell task.

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');

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
        }
    }
  },
})
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

Type: String

The shell command to run.

Type: Object The shell command options hash.

Type: Array

The shell command arguments.

####options.prefix Default: -- Type: String

The command option flag prefix.

####options.separator Default: Type: String

The command option key value separator.

grunt-shell

Try!