Skip to content

Commit

Permalink
Allow using top-level dir as ROOT_FOLDER
Browse files Browse the repository at this point in the history
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 adrianvlupu#9
  • Loading branch information
kevinbader committed May 4, 2020
1 parent 1cd976f commit 989a50f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions build.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 989a50f

Please sign in to comment.