Skip to content

Commit

Permalink
Started implementation of task.exec
Browse files Browse the repository at this point in the history
  • Loading branch information
DamonOehlman committed May 5, 2014
1 parent d5a5673 commit 06c7d8b
Showing 1 changed file with 23 additions and 1 deletion.
24 changes: 23 additions & 1 deletion index.js
Expand Up @@ -170,13 +170,35 @@ module.exports = function(opts) {
Run the specified task, with the provided arguments.
alias: `task.spawn`
**/
task.run = function(target) {
task.run = task.spawn = function(target) {
return task.prepare(target).apply(
null,
[].slice.call(arguments, 1)
);
};

/**
### task.exec(args, callback)
Using the args specified, run a task and execute the callback once the task
has completed. The task name is passed in `args[0]` with `args.slice(1)`
containing any parameters that should be passed to the task when it is
run.
The `task.exec` function has been optimized for use with a
[pull-stream](https://github.com/dominictarr/pull-stream) sink.
**/
task.exec = function(args, callback) {
// extract the task name
var name = args.splice(0)[0];

// prepare the task
var t = task.prepare(name);
};

return task;
};

0 comments on commit 06c7d8b

Please sign in to comment.