tasks/sketch.js
function registerTask( task ) {
		grunt.registerMultiTask( task.name, task.help, function () {
			var done = this.async();
			if ( ensureSketchtool() ) {
				var options = this.options();

				var commands = [];
				this.files.forEach( function( file ) {
					file.src.filter( function ( src ) {
						var command = createCommand( task, src, file.dest, options );
						if ( command ) {
							commands.push( command );
						}
					} );
				});
				
				async.eachLimit( commands, numCPUs, function ( command, next ) {
					executeCommand( command, next );
				}, done );
			} else {
				done(false);
			}
		} );
	}
function registerTask( task ) {
		grunt.registerMultiTask( task.name, task.help, function () {
			var done = this.async();
			if ( ensureSketchtool() ) {
				var options = this.options();

				var commands = [];
				this.files.forEach( function( file ) {
					file.src.filter( function ( src ) {
						var command = createCommand( task, src, file.dest, options );
						if ( command ) {
							commands.push( command );
						}
					} );
				});
				
				async.eachLimit( commands, numCPUs, function ( command, next ) {
					executeCommand( command, next );
				}, done );
			} else {
				done(false);
			}
		} );
	}
function registerTask ( task ) { grunt . registerMultiTask ( task . name , task . help , function ( ) { var done = this . async ( ) ; if ( ensureSketchtool ( ) ) { var options = this . options ( ) ; var commands = [ ] ; this . files . forEach ( function ( file ) { file . src . filter ( function ( src ) { var command = createCommand ( task , src , file . dest , options ) ; if ( command ) { commands . push ( command ) ; } } ) ; } ) ; async . eachLimit ( commands , numCPUs , function ( command , next ) { executeCommand ( command , next ) ; } , done ) ; } else { done ( false ) ; } } ) ; }
Internal helper functions.
Internal helper functions .