full site update
This commit is contained in:
2
node_modules/astro/dist/core/fs/index.d.ts
generated
vendored
2
node_modules/astro/dist/core/fs/index.d.ts
generated
vendored
@@ -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;
|
||||
|
7
node_modules/astro/dist/core/fs/index.js
generated
vendored
7
node_modules/astro/dist/core/fs/index.js
generated
vendored
@@ -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);
|
||||
}
|
||||
|
Reference in New Issue
Block a user