Skip to content

Commit

Permalink
fix: paths to lowercase #2
Browse files Browse the repository at this point in the history
  • Loading branch information
kmlbgn committed Apr 4, 2024
1 parent 980138a commit 6b32a37
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ tabs/
css/
static/
*.orig
*.bak
2 changes: 1 addition & 1 deletion src/HierarchicalNamedLayoutStrategy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export class HierarchicalNamedLayoutStrategy extends LayoutStrategy {
const path = context + "/" + sanitize(levelLabel).replaceAll(" ", "-");

const newPath = dirRoot + "/" + path;
fs.mkdirSync(newPath, { recursive: true });
fs.mkdirSync(newPath.toLowerCase(), { recursive: true });
this.addCategoryMetadata(newPath, order, levelLabel);
return path;
}
Expand Down
4 changes: 2 additions & 2 deletions src/images.ts
Original file line number Diff line number Diff line change
Expand Up @@ -195,8 +195,8 @@ function writeImageIfNew(path: string, buffer: Buffer) {
if (fs.pathExistsSync(path)) {
verbose("Replacing image " + path);
} else {
verbose("Adding image " + path);
fs.mkdirsSync(Path.dirname(path));
verbose("Adding image " + path.toLowerCase());
fs.mkdirsSync(Path.dirname(path.toLowerCase()));
}
fs.createWriteStream(path).write(buffer); // async but we're not waiting
}
Expand Down
4 changes: 2 additions & 2 deletions src/pull.ts
Original file line number Diff line number Diff line change
Expand Up @@ -301,9 +301,9 @@ async function getTabsPagesRecursively(
}

function writePage(page: NotionPage, finalMarkdown: string) {
const mdPath = layoutStrategy.getPathForPage(page, ".mdx");
const mdPath = layoutStrategy.getPathForPage(page, ".mdx").toLowerCase();
verbose(`writing ${mdPath}`);
fs.writeFileSync(mdPath.toLowerCase(), finalMarkdown, {});
fs.writeFileSync(mdPath, finalMarkdown, {});
++counts.output_normally;
}

Expand Down

0 comments on commit 6b32a37

Please sign in to comment.