full site update

This commit is contained in:
2025-07-24 18:46:24 +02:00
parent bfe2b90d8d
commit 37a6e0ab31
6912 changed files with 540482 additions and 361712 deletions

View File

@@ -1,2 +1,2 @@
export declare function removeEmptyDirs(root: URL): void;
export declare function removeEmptyDirs(dir: string): void;
export declare function emptyDir(_dir: URL, skip?: Set<string>): void;

View File

@@ -1,16 +1,13 @@
import fs from "node:fs";
import path from "node:path";
import { fileURLToPath } from "node:url";
import { appendForwardSlash } from "../path.js";
const isWindows = process.platform === "win32";
function removeEmptyDirs(root) {
const dir = fileURLToPath(root);
function removeEmptyDirs(dir) {
if (!fs.statSync(dir).isDirectory()) return;
let files = fs.readdirSync(dir);
if (files.length > 0) {
files.map((file) => {
const url = new URL(`./${file}`, appendForwardSlash(root.toString()));
removeEmptyDirs(url);
removeEmptyDirs(path.join(dir, file));
});
files = fs.readdirSync(dir);
}