Skip to content

Latest commit

 

History

History
59 lines (43 loc) · 1.63 KB

README.md

File metadata and controls

59 lines (43 loc) · 1.63 KB

build status grunt-exec

Grunt plugin for executing shell commands.

Getting Started

Install this grunt plugin next to your project's grunt.js gruntfile with: npm install grunt-exec

Then add this line to your project's grunt.js gruntfile:

grunt.loadNpmTasks('grunt-exec');

Documentation

This plugin is a multi task, meaning that grunt will automatically iterate over all exec targets if a target is not specified.

If the command used outputs to stderr, grunt-exec will display a warning and abort grunt immediately. Grunt will continue processing tasks if the --force command-line option was specified.

Target Properties

  • command(required): The shell command to be executed. Must be a string or a function that returns a string.
  • stdout(optional): Set true if you want the stdout to be printed. Defaults to false.

Example

grunt.initConfig({
  exec: {
    remove_logs: {
      command: 'rm -f *.log'
    },
    list_files: {
      command: 'ls -l **',
      stdout: true
    },
    echo_grunt_version: {
      command: function(grunt) { return 'echo ' + grunt.version; },
      stdout: true
    }
  }
});

License

Copyright (c) 2012 Jake Harding
Licensed under the MIT license.