Add util.pitch.

This commit is contained in:
John-David Dalton
2016-05-30 08:04:00 -07:00
parent 695d74d7c5
commit 77cf88a3bf
7 changed files with 98 additions and 62 deletions

View File

@@ -5,7 +5,8 @@ var _ = require('lodash'),
path = require('path');
var file = require('../common/file'),
mapping = require('../common/mapping');
mapping = require('../common/mapping'),
util = require('../common/util');
var templatePath = path.join(__dirname, 'template/doc'),
template = file.globTemplate(path.join(templatePath, '*.jst'));
@@ -34,7 +35,7 @@ function toArgOrder(indexes) {
}
/**
* Converts `funcNames` into a backticked chunked list string representation.
* Converts `funcNames` into a chunked list string representation.
*
* @param {string[]} funcNames The function names.
* @returns {string} Returns the function list string.
@@ -64,17 +65,6 @@ function toFuncList(funcNames) {
/*----------------------------------------------------------------------------*/
/**
* A no-frills callback that throws any error it receives.
*
* @param {Object} [error] The error object.
*/
function onComplete(error) {
if (error) {
throw error;
}
}
/**
* Creates the FP-Guide wiki at the `target` path.
*
@@ -82,7 +72,7 @@ function onComplete(error) {
*/
function build(target) {
target = path.resolve(target);
fs.writeFile(target, template.wiki(templateData), onComplete);
fs.writeFile(target, template.wiki(templateData), util.pitch);
}
build(_.last(process.argv));