Fix create folder logic in cli.js

The paths changed in d003ea01 to start with a forward slash, this broke
the create folder detection logic as now it matched the first slash of
the path instead of sub-folder in the path.  Fix by ignoring the first
character in the path.
This commit is contained in:
Hornwitser 2025-01-25 08:41:25 +01:00
parent ac1b1f13f4
commit cf3229423b

2
cli.ts
View file

@ -25,7 +25,7 @@ if (!fs.existsSync(outDir)) {
}
for (const page of pages) {
const dirSep = page.ref.indexOf("/");
const dirSep = page.ref.indexOf("/", 1);
if (dirSep !== -1) {
const dir = `${outDir}/${page.ref.slice(0, dirSep)}`;
if (!fs.existsSync(dir)) {