Doing the same task repeatedly is boring. Let the computer do it instead.
Let the computers do the boring stuff.
Usage: dullard -d <dir>,...,<dirN> <step1> ... <stepN>
Options:
--help, -? Show usage
--dirs, -d directories to load task files from
--list, -l List available tasks
--loglevel Chattiness, one of: silly, verbose, info, warn, error, & silent [default: "info"]
--quiet, -q Minimal output
--silent No output until something goes awry
--verbose, -v Verbose logging
Dullard will look for a file named dullfile.js
or dullfile.json
in the current directory or any parent directories & merge it with the CLI options (CLI takes precendence). It will merge all found results in the current branch of the directory tree with precedence being: CLI -> Local -> Parent -> ... -> Root
.
JSON version
{
"dirs" : [
"../../../tasks-a"
],
"steps" : [
"fooga"
]
}
JS version
/*jshint node:true */
"use strict";
module.exports = {
"dirs" : [
"../../tasks-a"
],
"steps" : {
main : [
"fooga"
],
finish : [
"wooga"
],
default : [
"main",
"finish"
]
}
};
dirs
is an array of directories to load tasks from. steps
is one of two options: 1) an array of strings/functions or 2) an object containing named step collections that are each an array of strings/fucntions. Strings should match either the names of files in the task directories stripped of their extension or the name of a step collection.
The config object will be passed as the first argument (config
by convention) to tasks.
Tasks are simple modules that should export a single function. Each task function gets passed two arguments, a shared config object for state in the task chain & an optional callback for async tasks. The callback takes two possible arguments, an error object and an optional object to replace the shared config object. If the task is synchronous any return value will be considered an error.
// Passing tasks
function exampleTaskSync(config) {
...
}
function exampleTaskAsync(config, done) {
...
process.nextTick(done);
}
// Failing tasks
function exampleTaskFailureSync(config) {
return "Task failed";
}
function exampleTaskFailureAsync(config, done) {
done("Task Failed");
}
A: Nothing built-in yet, still trying to figure out if I'm comfortable with cluttering up the .dullfile
(s) with watcher config stuff. For now check out this gist.