htmlhost-cli 2.2.0 → 2.2.1
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 +10 -5
package/package.json
CHANGED
package/src/cli.mjs
CHANGED
package/src/commands/deploy.mjs
CHANGED
|
@@ -609,12 +609,17 @@ function findAllFiles(baseDir, currentDir) {
|
|
|
609
609
|
}
|
|
610
610
|
}
|
|
611
611
|
|
|
612
|
-
// Sort: index.html first, then HTML files, then others alphabetically
|
|
612
|
+
// Sort: root index.html first, then any nested index.html, then HTML files, then others alphabetically
|
|
613
613
|
results.sort((a, b) => {
|
|
614
|
-
const
|
|
615
|
-
const
|
|
616
|
-
if (
|
|
617
|
-
if (
|
|
614
|
+
const aIsRootIndex = a.relativePath === "index.html";
|
|
615
|
+
const bIsRootIndex = b.relativePath === "index.html";
|
|
616
|
+
if (aIsRootIndex) return -1;
|
|
617
|
+
if (bIsRootIndex) return 1;
|
|
618
|
+
|
|
619
|
+
const aIsIndex = basename(a.relativePath) === "index.html";
|
|
620
|
+
const bIsIndex = basename(b.relativePath) === "index.html";
|
|
621
|
+
if (aIsIndex && !bIsIndex) return -1;
|
|
622
|
+
if (!aIsIndex && bIsIndex) return 1;
|
|
618
623
|
|
|
619
624
|
const aIsHtml = a.relativePath.endsWith(".html");
|
|
620
625
|
const bIsHtml = b.relativePath.endsWith(".html");
|