Move copying of scaffolding files into scaffold.js
This commit is contained in:
parent
59b82e7ab4
commit
23e79ed6ba
3 changed files with 15 additions and 13 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue