From 989a50ff4cbdbdfa463682468433be34e4c0be87 Mon Sep 17 00:00:00 2001 From: Kevin Bader Date: Mon, 4 May 2020 11:48:06 +0200 Subject: [PATCH] Allow using top-level dir as ROOT_FOLDER By ignoring the output folder (DIST_FOLDER), we allow a user to use the top-level directory as the source folder (ROOT_FOLDER). This is useful when the top-level README file provides introduction and getting-started material and should be included in the generated files. Closes #9 --- build.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/build.js b/build.js index 9e317ba..32f7d2b 100644 --- a/build.js +++ b/build.js @@ -24,6 +24,11 @@ const generateTree = async (dir, options) => { let tree = []; const build = async (dir, parent) => { + // Skip output folder - this allows a user to use the top-level folder as ROOT_FOLDER. + if (dir === options.DIST_FOLDER) { + return + } + let name = getFolderName(dir, options.ROOT_FOLDER, options.HOMEPAGE_NAME); let item = tree.find(x => x.dir === dir); if (!item) {