runonymous-grunt

0.0.1 • Public • Published

runonymous-grunt

Build Status

Queue an anonymous function with grunt.task.run. Often used to log or cleanup after delegating some work to another task via grunt.task.run('some:other:task').

grunt.registerTask('foo', function() {
  grunt.task.run(
    'beep',
    'boop',
    function() {            // Check out this anonymous function!
      grunt.log.ok('done'); // 'done' will be logged after the 'boop' task finishes
    }
});

Getting Started

Grunt ~0.4.1

You should be comfy with the grunt basics and npm so you can install this in your project

> npm install runonymous-grunt --save-dev

Here's an example where some extra logging helps us distinguish between similar targets

require('runonymous-grunt')(grunt);
grunt.loadNpmTasks('grunt-contrib-jasmine');
 
grunt.registerTask('spec:shared', function() {
  grunt.task.run(
    function() {
      grunt.log.writeln('Testing shared code in the browser');
    },
    'jasmine:client',
 
    function() {
      grunt.log.writeln('Testing shared code on the server');
    },
    'jasmine:server',
});

It's even cleaner in coffeescript:

require('runonymous-grunt')(grunt)
grunt.loadNpmTasks('grunt-contrib-jasmine')
 
grunt.registerTask 'spec:shared, ->
  grunt.task.run(
    -> grunt.log.writeln('Testing shared code in the browser')
    'jasmine:client'
 
    -> grunt.log.writeln('Testing shared code on the server')
    'jasmine:server'
  )

Readme

Keywords

none

Package Sidebar

Install

npm i runonymous-grunt

Weekly Downloads

1

Version

0.0.1

License

MIT

Last publish

Collaborators

  • hurrymaplelad