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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "htmlhost-cli",
3
- "version": "2.1.4",
3
+ "version": "2.1.6",
4
4
  "description": "Deploy HTML files from the terminal — htmlhost.co CLI",
5
5
  "type": "module",
6
6
  "bin": {
package/src/cli.mjs CHANGED
@@ -4,7 +4,7 @@
4
4
  import { bold, dim, cyan, err } from "./ui.mjs";
5
5
  import { ApiError } from "./api.mjs";
6
6
 
7
- const VERSION = "2.1.3";
7
+ const VERSION = "2.1.6";
8
8
 
9
9
  const HELP = `
10
10
  ${bold("htmlhost")} ${dim(`v${VERSION}`)} — deploy HTML from the terminal
@@ -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
  }