This commit is contained in:
2026-08-14 16:03:47 +01:00
parent fd53e3f4fb
commit dfdc3b2840
2463 changed files with 186456 additions and 111315 deletions
+5 -6
View File
@@ -65,7 +65,7 @@ export const mkdir = (dir, opt, cb) => {
mkdir_(cwd, parts, mode, unlink, cwd, undefined, done);
};
const mkdir_ = (base, parts, mode, unlink, cwd, created, cb) => {
if (!parts.length) {
if (parts.length === 0) {
return cb(null, created);
}
const p = parts.shift();
@@ -76,8 +76,7 @@ const onmkdir = (part, parts, mode, unlink, cwd, created, cb) => (er) => {
if (er) {
fs.lstat(part, (statEr, st) => {
if (statEr) {
statEr.path =
statEr.path && normalizeWindowsPath(statEr.path);
statEr.path = statEr.path && normalizeWindowsPath(statEr.path);
cb(statEr);
}
else if (st.isDirectory()) {
@@ -106,7 +105,7 @@ const onmkdir = (part, parts, mode, unlink, cwd, created, cb) => (er) => {
};
const checkCwdSync = (dir) => {
let ok = false;
let code = undefined;
let code;
try {
ok = fs.statSync(dir).isDirectory();
}
@@ -152,14 +151,14 @@ export const mkdirSync = (dir, opt) => {
}
const sub = normalizeWindowsPath(path.relative(cwd, dir));
const parts = sub.split('/');
let created = undefined;
let created;
for (let p = parts.shift(), part = cwd; p && (part += '/' + p); p = parts.shift()) {
part = normalizeWindowsPath(path.resolve(part));
try {
fs.mkdirSync(part, mode);
created = created || part;
}
catch (er) {
catch {
const st = fs.lstatSync(part);
if (st.isDirectory()) {
continue;