Move copying of scaffolding files into scaffold.js

This commit is contained in:
Domenic Denicola 2015-05-21 00:58:43 -04:00
commit 23e79ed6ba
3 changed files with 15 additions and 13 deletions

View file

@ -1,6 +1,7 @@
"use strict";
const fs = require("mz/fs");
const path = require("path");
const cpr = require("thenify")(require("cpr"));
const BOOK_TITLE = "Worm";
const BOOK_AUTHOR = "wildbow";
@ -8,13 +9,17 @@ const BOOK_ID = "urn:uuid:e7f3532d-8db6-4888-be80-1976166b7059";
const NCX_FILENAME = "toc.ncx";
module.exports = function (contentPath, chaptersPath, manifestPath) {
return getChapters(contentPath, chaptersPath, manifestPath).then(function (chapters) {
return Promise.all([
writeOpf(chapters, contentPath),
writeNcx(chapters, contentPath)
]);
});
module.exports = function (scaffoldingPath, bookPath, contentPath, chaptersPath, manifestPath) {
return Promise.all([
cpr(scaffoldingPath, bookPath),
getChapters(contentPath, chaptersPath, manifestPath).then(function (chapters) {
return Promise.all([
writeOpf(chapters, contentPath),
writeNcx(chapters, contentPath)
]);
})
])
.then(function () { });
};
function writeOpf(chapters, contentPath) {