Skip to content

Commit

Permalink
only convert paths when the they aren't already posix
Browse files Browse the repository at this point in the history
  • Loading branch information
timgoeller committed Dec 17, 2020
1 parent 82eef4a commit 1d260f7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion monotome/bin/generate.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ function walk(dir) {

const cwd = process.cwd()
walk(cwd).then((data) => {
data = data.map(data => data.split(path.sep).join(path.posix.sep))
if (path.sep != path.posix.sep)
data = data.map(data => data.split(path.sep).join(path.posix.sep))
data.sort((a, b) => a.localeCompare(b)); // sort lexicographically, so that sub-folders are under parent
var pattern = /(.*\/)+(.*\.md)/
var ignore = /\..*\/.*/ // ignore folders starting with a period, e.g. `.archives`
Expand Down

0 comments on commit 1d260f7

Please sign in to comment.