Skip to content

liebrand/grunt-exec

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

Grunt plugin for executing shell commands.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%