htmlhost-cli 2.1.4 → 2.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/cli.mjs +1 -1
- package/src/commands/deploy.mjs +7 -0
package/package.json
CHANGED
package/src/cli.mjs
CHANGED
package/src/commands/deploy.mjs
CHANGED
|
@@ -347,6 +347,7 @@ async function deployDirectory(dirPath, { ttl, title, slug: explicitSlug, forceN
|
|
|
347
347
|
info(`Processing ${cyan(bold(String(htmlFiles.length)))} page${htmlFiles.length > 1 ? "s" : ""}…`);
|
|
348
348
|
|
|
349
349
|
const pagePayloads = [];
|
|
350
|
+
const seenPaths = new Set();
|
|
350
351
|
|
|
351
352
|
for (const file of htmlFiles) {
|
|
352
353
|
const html = readFileSync(file.filePath, "utf8");
|
|
@@ -362,6 +363,12 @@ async function deployDirectory(dirPath, { ttl, title, slug: explicitSlug, forceN
|
|
|
362
363
|
pagePath = "/" + file.relativePath.replace(/\.html$/, "");
|
|
363
364
|
}
|
|
364
365
|
|
|
366
|
+
if (seenPaths.has(pagePath)) {
|
|
367
|
+
info(`Skipping duplicate route: ${cyan(file.relativePath)} (conflicts with existing ${pagePath})`);
|
|
368
|
+
continue;
|
|
369
|
+
}
|
|
370
|
+
seenPaths.add(pagePath);
|
|
371
|
+
|
|
365
372
|
pagePayloads.push({ path: pagePath, html });
|
|
366
373
|
ok(`${cyan(file.relativePath)} → ${cyan(pagePath)}`);
|
|
367
374
|
}
|