@prisma/internals 6.5.0-integration-fix-improve-global-omit-api-performance.1 → 6.5.0-integration-fix-improve-global-omit-api-performance-2.2
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/dist/{chunk-NXIWDQBF.js → chunk-3ERIN7PH.js} +5 -5
- package/dist/{chunk-5IPJRW2I.js → chunk-44KDLAL5.js} +7 -7
- package/dist/{chunk-P6JWAE6V.js → chunk-5YHJX6R5.js} +7 -7
- package/dist/{chunk-PSRK3GOS.js → chunk-7O5FFHIL.js} +39 -39
- package/dist/{chunk-5BZGQIRH.js → chunk-B2T7C2JL.js} +8 -8
- package/dist/{chunk-YSTRHGMU.js → chunk-FCLUXCBK.js} +5 -5
- package/dist/{chunk-QIVUAERL.js → chunk-GXDYIY4M.js} +1653 -1762
- package/dist/{chunk-H72GY63K.js → chunk-GXFFRDHK.js} +5 -5
- package/dist/{chunk-55RMSBQJ.js → chunk-IZ57EPVG.js} +776 -5
- package/dist/{chunk-2ILJBEIH.js → chunk-JRM42MK6.js} +5 -5
- package/dist/{chunk-G4BGJ6IP.js → chunk-KTBNIQ7N.js} +5 -5
- package/dist/{chunk-6TLRRQOC.js → chunk-MNMUVVYF.js} +8 -8
- package/dist/{chunk-ANCBOVIA.js → chunk-MVKD2LHS.js} +5 -5
- package/dist/{chunk-LK7U6TVK.js → chunk-NGOBF53T.js} +5 -5
- package/dist/{chunk-5XRQ7ONW.js → chunk-NJQWZ447.js} +5 -5
- package/dist/{chunk-SWSM63QH.js → chunk-NLCHWJIS.js} +39 -39
- package/dist/{chunk-IYHRQZ3I.js → chunk-ONTDFIZS.js} +8 -8
- package/dist/{chunk-WQXRNCPP.js → chunk-R3D6TBV3.js} +5 -5
- package/dist/{chunk-OYLZC5OV.js → chunk-TATYN3T2.js} +7 -7
- package/dist/{chunk-FTOI2OF7.js → chunk-TTPEDDRA.js} +5 -5
- package/dist/{chunk-DS5HCKHK.js → chunk-VURXE4OO.js} +7 -7
- package/dist/{chunk-K2RINR4Y.js → chunk-XHDNML25.js} +8 -8
- package/dist/{chunk-IWJ2BUYF.js → chunk-XLGODPZH.js} +5 -5
- package/dist/{chunk-3Q7XYZ62.js → chunk-ZDVVJKE3.js} +5 -5
- package/dist/{chunk-5S3CE7X2.js → chunk-ZKRL3DGS.js} +8 -8
- package/dist/{chunk-IYFPIGGM.js → chunk-ZLVVUJ3P.js} +8 -8
- package/dist/{chunk-4AIOCFJV.js → chunk-ZYIJBRFI.js} +6 -6
- package/dist/cli/checkUnsupportedDataProxy.js +19 -20
- package/dist/cli/getSchema.js +23 -24
- package/dist/cli/hashes.js +19 -20
- package/dist/engine-commands/errorHelpers.js +4 -4
- package/dist/engine-commands/formatSchema.js +18 -19
- package/dist/engine-commands/getConfig.js +10 -10
- package/dist/engine-commands/getDmmf.js +7 -7
- package/dist/engine-commands/getEngineVersion.js +5 -6
- package/dist/engine-commands/getEnginesMetaInfo.js +7 -8
- package/dist/engine-commands/index.js +29 -30
- package/dist/engine-commands/lintSchema.js +8 -8
- package/dist/engine-commands/mergeSchemas.js +7 -7
- package/dist/engine-commands/validate.js +7 -7
- package/dist/get-generators/generatorResolvers/generatorResolvers.js +18 -19
- package/dist/get-generators/generatorResolvers/prisma-client-js/check-dependencies/checkTypeScriptVersion.js +18 -19
- package/dist/get-generators/generatorResolvers/prisma-client-js/prismaClientResolver.js +19 -20
- package/dist/get-generators/getGenerators.js +21 -22
- package/dist/get-generators/utils/getBinaryPathsByVersion.js +3 -4
- package/dist/getPackedPackage.js +2 -3
- package/dist/index.js +56 -57
- package/dist/resolveBinary.js +7 -8
- package/dist/schemaEngineCommands.js +8 -9
- package/dist/sendPanic.js +18 -19
- package/dist/utils/getEnvPaths.js +18 -19
- package/dist/utils/getVersionFromPackageJson.js +3 -3
- package/dist/utils/handlePanic.js +18 -19
- package/dist/utils/loadEnvFile.js +18 -19
- package/dist/wasm.js +4 -4
- package/package.json +11 -11
- package/dist/chunk-H4J2FN2W.js +0 -796
@@ -16,27 +16,23 @@ var __copyProps = (to, from, except, desc) => {
|
|
16
16
|
return to;
|
17
17
|
};
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
19
|
-
var
|
20
|
-
__export(
|
21
|
-
require_graceful_fs: () =>
|
19
|
+
var chunk_GXDYIY4M_exports = {};
|
20
|
+
__export(chunk_GXDYIY4M_exports, {
|
21
|
+
require_graceful_fs: () => require_graceful_fs,
|
22
22
|
require_lib: () => require_lib
|
23
23
|
});
|
24
|
-
module.exports = __toCommonJS(
|
25
|
-
var import_chunk_H4J2FN2W = require("./chunk-H4J2FN2W.js");
|
24
|
+
module.exports = __toCommonJS(chunk_GXDYIY4M_exports);
|
26
25
|
var import_chunk_WWAWV7DQ = require("./chunk-WWAWV7DQ.js");
|
27
26
|
var require_universalify = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
28
|
-
"../../node_modules/.pnpm/universalify@2.0.
|
27
|
+
"../../node_modules/.pnpm/universalify@2.0.1/node_modules/universalify/index.js"(exports) {
|
29
28
|
"use strict";
|
30
29
|
exports.fromCallback = function(fn) {
|
31
30
|
return Object.defineProperty(function(...args) {
|
32
31
|
if (typeof args[args.length - 1] === "function") fn.apply(this, args);
|
33
32
|
else {
|
34
33
|
return new Promise((resolve, reject) => {
|
35
|
-
|
36
|
-
|
37
|
-
...args,
|
38
|
-
(err, res) => err != null ? reject(err) : resolve(res)
|
39
|
-
);
|
34
|
+
args.push((err, res) => err != null ? reject(err) : resolve(res));
|
35
|
+
fn.apply(this, args);
|
40
36
|
});
|
41
37
|
}
|
42
38
|
}, "name", { value: fn.name });
|
@@ -45,1832 +41,1756 @@ var require_universalify = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
45
41
|
return Object.defineProperty(function(...args) {
|
46
42
|
const cb = args[args.length - 1];
|
47
43
|
if (typeof cb !== "function") return fn.apply(this, args);
|
48
|
-
else
|
44
|
+
else {
|
45
|
+
args.pop();
|
46
|
+
fn.apply(this, args).then((r) => cb(null, r), cb);
|
47
|
+
}
|
49
48
|
}, "name", { value: fn.name });
|
50
49
|
};
|
51
50
|
}
|
52
51
|
});
|
53
|
-
var
|
54
|
-
"../../node_modules/.pnpm/fs
|
52
|
+
var require_polyfills = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
53
|
+
"../../node_modules/.pnpm/graceful-fs@4.2.11/node_modules/graceful-fs/polyfills.js"(exports, module2) {
|
55
54
|
"use strict";
|
56
|
-
var
|
57
|
-
var
|
58
|
-
var
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
"copyFile",
|
65
|
-
"fchmod",
|
66
|
-
"fchown",
|
67
|
-
"fdatasync",
|
68
|
-
"fstat",
|
69
|
-
"fsync",
|
70
|
-
"ftruncate",
|
71
|
-
"futimes",
|
72
|
-
"lchmod",
|
73
|
-
"lchown",
|
74
|
-
"link",
|
75
|
-
"lstat",
|
76
|
-
"mkdir",
|
77
|
-
"mkdtemp",
|
78
|
-
"open",
|
79
|
-
"opendir",
|
80
|
-
"readdir",
|
81
|
-
"readFile",
|
82
|
-
"readlink",
|
83
|
-
"realpath",
|
84
|
-
"rename",
|
85
|
-
"rm",
|
86
|
-
"rmdir",
|
87
|
-
"stat",
|
88
|
-
"symlink",
|
89
|
-
"truncate",
|
90
|
-
"unlink",
|
91
|
-
"utimes",
|
92
|
-
"writeFile"
|
93
|
-
].filter((key) => {
|
94
|
-
return typeof fs[key] === "function";
|
95
|
-
});
|
96
|
-
Object.assign(exports, fs);
|
97
|
-
api.forEach((method) => {
|
98
|
-
exports[method] = u(fs[method]);
|
99
|
-
});
|
100
|
-
exports.exists = function(filename, callback) {
|
101
|
-
if (typeof callback === "function") {
|
102
|
-
return fs.exists(filename, callback);
|
103
|
-
}
|
104
|
-
return new Promise((resolve) => {
|
105
|
-
return fs.exists(filename, resolve);
|
106
|
-
});
|
55
|
+
var constants = (0, import_chunk_WWAWV7DQ.__require)("constants");
|
56
|
+
var origCwd = process.cwd;
|
57
|
+
var cwd = null;
|
58
|
+
var platform = process.env.GRACEFUL_FS_PLATFORM || process.platform;
|
59
|
+
process.cwd = function() {
|
60
|
+
if (!cwd)
|
61
|
+
cwd = origCwd.call(process);
|
62
|
+
return cwd;
|
107
63
|
};
|
108
|
-
|
109
|
-
|
110
|
-
|
64
|
+
try {
|
65
|
+
process.cwd();
|
66
|
+
} catch (er) {
|
67
|
+
}
|
68
|
+
if (typeof process.chdir === "function") {
|
69
|
+
chdir = process.chdir;
|
70
|
+
process.chdir = function(d) {
|
71
|
+
cwd = null;
|
72
|
+
chdir.call(process, d);
|
73
|
+
};
|
74
|
+
if (Object.setPrototypeOf) Object.setPrototypeOf(process.chdir, chdir);
|
75
|
+
}
|
76
|
+
var chdir;
|
77
|
+
module2.exports = patch;
|
78
|
+
function patch(fs) {
|
79
|
+
if (constants.hasOwnProperty("O_SYMLINK") && process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)) {
|
80
|
+
patchLchmod(fs);
|
111
81
|
}
|
112
|
-
|
113
|
-
fs
|
114
|
-
if (err) return reject(err);
|
115
|
-
resolve({ bytesRead, buffer: buffer2 });
|
116
|
-
});
|
117
|
-
});
|
118
|
-
};
|
119
|
-
exports.write = function(fd, buffer, ...args) {
|
120
|
-
if (typeof args[args.length - 1] === "function") {
|
121
|
-
return fs.write(fd, buffer, ...args);
|
82
|
+
if (!fs.lutimes) {
|
83
|
+
patchLutimes(fs);
|
122
84
|
}
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
85
|
+
fs.chown = chownFix(fs.chown);
|
86
|
+
fs.fchown = chownFix(fs.fchown);
|
87
|
+
fs.lchown = chownFix(fs.lchown);
|
88
|
+
fs.chmod = chmodFix(fs.chmod);
|
89
|
+
fs.fchmod = chmodFix(fs.fchmod);
|
90
|
+
fs.lchmod = chmodFix(fs.lchmod);
|
91
|
+
fs.chownSync = chownFixSync(fs.chownSync);
|
92
|
+
fs.fchownSync = chownFixSync(fs.fchownSync);
|
93
|
+
fs.lchownSync = chownFixSync(fs.lchownSync);
|
94
|
+
fs.chmodSync = chmodFixSync(fs.chmodSync);
|
95
|
+
fs.fchmodSync = chmodFixSync(fs.fchmodSync);
|
96
|
+
fs.lchmodSync = chmodFixSync(fs.lchmodSync);
|
97
|
+
fs.stat = statFix(fs.stat);
|
98
|
+
fs.fstat = statFix(fs.fstat);
|
99
|
+
fs.lstat = statFix(fs.lstat);
|
100
|
+
fs.statSync = statFixSync(fs.statSync);
|
101
|
+
fs.fstatSync = statFixSync(fs.fstatSync);
|
102
|
+
fs.lstatSync = statFixSync(fs.lstatSync);
|
103
|
+
if (fs.chmod && !fs.lchmod) {
|
104
|
+
fs.lchmod = function(path, mode, cb) {
|
105
|
+
if (cb) process.nextTick(cb);
|
106
|
+
};
|
107
|
+
fs.lchmodSync = function() {
|
108
|
+
};
|
133
109
|
}
|
134
|
-
|
135
|
-
fs.
|
136
|
-
if (
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
110
|
+
if (fs.chown && !fs.lchown) {
|
111
|
+
fs.lchown = function(path, uid, gid, cb) {
|
112
|
+
if (cb) process.nextTick(cb);
|
113
|
+
};
|
114
|
+
fs.lchownSync = function() {
|
115
|
+
};
|
116
|
+
}
|
117
|
+
if (platform === "win32") {
|
118
|
+
fs.rename = typeof fs.rename !== "function" ? fs.rename : function(fs$rename) {
|
119
|
+
function rename(from, to, cb) {
|
120
|
+
var start = Date.now();
|
121
|
+
var backoff = 0;
|
122
|
+
fs$rename(from, to, function CB(er) {
|
123
|
+
if (er && (er.code === "EACCES" || er.code === "EPERM" || er.code === "EBUSY") && Date.now() - start < 6e4) {
|
124
|
+
setTimeout(function() {
|
125
|
+
fs.stat(to, function(stater, st) {
|
126
|
+
if (stater && stater.code === "ENOENT")
|
127
|
+
fs$rename(from, to, CB);
|
128
|
+
else
|
129
|
+
cb(er);
|
130
|
+
});
|
131
|
+
}, backoff);
|
132
|
+
if (backoff < 100)
|
133
|
+
backoff += 10;
|
134
|
+
return;
|
135
|
+
}
|
136
|
+
if (cb) cb(er);
|
137
|
+
});
|
138
|
+
}
|
139
|
+
if (Object.setPrototypeOf) Object.setPrototypeOf(rename, fs$rename);
|
140
|
+
return rename;
|
141
|
+
}(fs.rename);
|
142
|
+
}
|
143
|
+
fs.read = typeof fs.read !== "function" ? fs.read : function(fs$read) {
|
144
|
+
function read(fd, buffer, offset, length, position, callback_) {
|
145
|
+
var callback;
|
146
|
+
if (callback_ && typeof callback_ === "function") {
|
147
|
+
var eagCounter = 0;
|
148
|
+
callback = function(er, _, __) {
|
149
|
+
if (er && er.code === "EAGAIN" && eagCounter < 10) {
|
150
|
+
eagCounter++;
|
151
|
+
return fs$read.call(fs, fd, buffer, offset, length, position, callback);
|
152
|
+
}
|
153
|
+
callback_.apply(this, arguments);
|
154
|
+
};
|
155
|
+
}
|
156
|
+
return fs$read.call(fs, fd, buffer, offset, length, position, callback);
|
157
|
+
}
|
158
|
+
if (Object.setPrototypeOf) Object.setPrototypeOf(read, fs$read);
|
159
|
+
return read;
|
160
|
+
}(fs.read);
|
161
|
+
fs.readSync = typeof fs.readSync !== "function" ? fs.readSync : /* @__PURE__ */ function(fs$readSync) {
|
162
|
+
return function(fd, buffer, offset, length, position) {
|
163
|
+
var eagCounter = 0;
|
164
|
+
while (true) {
|
165
|
+
try {
|
166
|
+
return fs$readSync.call(fs, fd, buffer, offset, length, position);
|
167
|
+
} catch (er) {
|
168
|
+
if (er.code === "EAGAIN" && eagCounter < 10) {
|
169
|
+
eagCounter++;
|
170
|
+
continue;
|
171
|
+
}
|
172
|
+
throw er;
|
173
|
+
}
|
174
|
+
}
|
175
|
+
};
|
176
|
+
}(fs.readSync);
|
177
|
+
function patchLchmod(fs2) {
|
178
|
+
fs2.lchmod = function(path, mode, callback) {
|
179
|
+
fs2.open(
|
180
|
+
path,
|
181
|
+
constants.O_WRONLY | constants.O_SYMLINK,
|
182
|
+
mode,
|
183
|
+
function(err, fd) {
|
184
|
+
if (err) {
|
185
|
+
if (callback) callback(err);
|
186
|
+
return;
|
187
|
+
}
|
188
|
+
fs2.fchmod(fd, mode, function(err2) {
|
189
|
+
fs2.close(fd, function(err22) {
|
190
|
+
if (callback) callback(err2 || err22);
|
191
|
+
});
|
192
|
+
});
|
193
|
+
}
|
194
|
+
);
|
195
|
+
};
|
196
|
+
fs2.lchmodSync = function(path, mode) {
|
197
|
+
var fd = fs2.openSync(path, constants.O_WRONLY | constants.O_SYMLINK, mode);
|
198
|
+
var threw = true;
|
199
|
+
var ret;
|
200
|
+
try {
|
201
|
+
ret = fs2.fchmodSync(fd, mode);
|
202
|
+
threw = false;
|
203
|
+
} finally {
|
204
|
+
if (threw) {
|
205
|
+
try {
|
206
|
+
fs2.closeSync(fd);
|
207
|
+
} catch (er) {
|
208
|
+
}
|
209
|
+
} else {
|
210
|
+
fs2.closeSync(fd);
|
211
|
+
}
|
212
|
+
}
|
213
|
+
return ret;
|
214
|
+
};
|
215
|
+
}
|
216
|
+
function patchLutimes(fs2) {
|
217
|
+
if (constants.hasOwnProperty("O_SYMLINK") && fs2.futimes) {
|
218
|
+
fs2.lutimes = function(path, at, mt, cb) {
|
219
|
+
fs2.open(path, constants.O_SYMLINK, function(er, fd) {
|
220
|
+
if (er) {
|
221
|
+
if (cb) cb(er);
|
222
|
+
return;
|
223
|
+
}
|
224
|
+
fs2.futimes(fd, at, mt, function(er2) {
|
225
|
+
fs2.close(fd, function(er22) {
|
226
|
+
if (cb) cb(er2 || er22);
|
227
|
+
});
|
228
|
+
});
|
229
|
+
});
|
230
|
+
};
|
231
|
+
fs2.lutimesSync = function(path, at, mt) {
|
232
|
+
var fd = fs2.openSync(path, constants.O_SYMLINK);
|
233
|
+
var ret;
|
234
|
+
var threw = true;
|
235
|
+
try {
|
236
|
+
ret = fs2.futimesSync(fd, at, mt);
|
237
|
+
threw = false;
|
238
|
+
} finally {
|
239
|
+
if (threw) {
|
240
|
+
try {
|
241
|
+
fs2.closeSync(fd);
|
242
|
+
} catch (er) {
|
243
|
+
}
|
244
|
+
} else {
|
245
|
+
fs2.closeSync(fd);
|
246
|
+
}
|
247
|
+
}
|
248
|
+
return ret;
|
249
|
+
};
|
250
|
+
} else if (fs2.futimes) {
|
251
|
+
fs2.lutimes = function(_a, _b, _c, cb) {
|
252
|
+
if (cb) process.nextTick(cb);
|
253
|
+
};
|
254
|
+
fs2.lutimesSync = function() {
|
255
|
+
};
|
256
|
+
}
|
257
|
+
}
|
258
|
+
function chmodFix(orig) {
|
259
|
+
if (!orig) return orig;
|
260
|
+
return function(target, mode, cb) {
|
261
|
+
return orig.call(fs, target, mode, function(er) {
|
262
|
+
if (chownErOk(er)) er = null;
|
263
|
+
if (cb) cb.apply(this, arguments);
|
264
|
+
});
|
265
|
+
};
|
266
|
+
}
|
267
|
+
function chmodFixSync(orig) {
|
268
|
+
if (!orig) return orig;
|
269
|
+
return function(target, mode) {
|
270
|
+
try {
|
271
|
+
return orig.call(fs, target, mode);
|
272
|
+
} catch (er) {
|
273
|
+
if (!chownErOk(er)) throw er;
|
274
|
+
}
|
275
|
+
};
|
276
|
+
}
|
277
|
+
function chownFix(orig) {
|
278
|
+
if (!orig) return orig;
|
279
|
+
return function(target, uid, gid, cb) {
|
280
|
+
return orig.call(fs, target, uid, gid, function(er) {
|
281
|
+
if (chownErOk(er)) er = null;
|
282
|
+
if (cb) cb.apply(this, arguments);
|
283
|
+
});
|
284
|
+
};
|
285
|
+
}
|
286
|
+
function chownFixSync(orig) {
|
287
|
+
if (!orig) return orig;
|
288
|
+
return function(target, uid, gid) {
|
289
|
+
try {
|
290
|
+
return orig.call(fs, target, uid, gid);
|
291
|
+
} catch (er) {
|
292
|
+
if (!chownErOk(er)) throw er;
|
293
|
+
}
|
294
|
+
};
|
295
|
+
}
|
296
|
+
function statFix(orig) {
|
297
|
+
if (!orig) return orig;
|
298
|
+
return function(target, options, cb) {
|
299
|
+
if (typeof options === "function") {
|
300
|
+
cb = options;
|
301
|
+
options = null;
|
302
|
+
}
|
303
|
+
function callback(er, stats) {
|
304
|
+
if (stats) {
|
305
|
+
if (stats.uid < 0) stats.uid += 4294967296;
|
306
|
+
if (stats.gid < 0) stats.gid += 4294967296;
|
307
|
+
}
|
308
|
+
if (cb) cb.apply(this, arguments);
|
309
|
+
}
|
310
|
+
return options ? orig.call(fs, target, options, callback) : orig.call(fs, target, callback);
|
311
|
+
};
|
312
|
+
}
|
313
|
+
function statFixSync(orig) {
|
314
|
+
if (!orig) return orig;
|
315
|
+
return function(target, options) {
|
316
|
+
var stats = options ? orig.call(fs, target, options) : orig.call(fs, target);
|
317
|
+
if (stats) {
|
318
|
+
if (stats.uid < 0) stats.uid += 4294967296;
|
319
|
+
if (stats.gid < 0) stats.gid += 4294967296;
|
320
|
+
}
|
321
|
+
return stats;
|
322
|
+
};
|
323
|
+
}
|
324
|
+
function chownErOk(er) {
|
325
|
+
if (!er)
|
326
|
+
return true;
|
327
|
+
if (er.code === "ENOSYS")
|
328
|
+
return true;
|
329
|
+
var nonroot = !process.getuid || process.getuid() !== 0;
|
330
|
+
if (nonroot) {
|
331
|
+
if (er.code === "EINVAL" || er.code === "EPERM")
|
332
|
+
return true;
|
333
|
+
}
|
334
|
+
return false;
|
144
335
|
}
|
145
|
-
return new Promise((resolve, reject) => {
|
146
|
-
fs.writev(fd, buffers, ...args, (err, bytesWritten, buffers2) => {
|
147
|
-
if (err) return reject(err);
|
148
|
-
resolve({ bytesWritten, buffers: buffers2 });
|
149
|
-
});
|
150
|
-
});
|
151
|
-
};
|
152
|
-
if (typeof fs.realpath.native === "function") {
|
153
|
-
exports.realpath.native = u(fs.realpath.native);
|
154
|
-
} else {
|
155
|
-
process.emitWarning(
|
156
|
-
"fs.realpath.native is not a function. Is fs being monkey-patched?",
|
157
|
-
"Warning",
|
158
|
-
"fs-extra-WARN0003"
|
159
|
-
);
|
160
336
|
}
|
161
337
|
}
|
162
338
|
});
|
163
|
-
var
|
164
|
-
"../../node_modules/.pnpm/fs
|
339
|
+
var require_legacy_streams = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
340
|
+
"../../node_modules/.pnpm/graceful-fs@4.2.11/node_modules/graceful-fs/legacy-streams.js"(exports, module2) {
|
165
341
|
"use strict";
|
166
|
-
var
|
167
|
-
module2.exports
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
342
|
+
var Stream = (0, import_chunk_WWAWV7DQ.__require)("stream").Stream;
|
343
|
+
module2.exports = legacy;
|
344
|
+
function legacy(fs) {
|
345
|
+
return {
|
346
|
+
ReadStream,
|
347
|
+
WriteStream
|
348
|
+
};
|
349
|
+
function ReadStream(path, options) {
|
350
|
+
if (!(this instanceof ReadStream)) return new ReadStream(path, options);
|
351
|
+
Stream.call(this);
|
352
|
+
var self = this;
|
353
|
+
this.path = path;
|
354
|
+
this.fd = null;
|
355
|
+
this.readable = true;
|
356
|
+
this.paused = false;
|
357
|
+
this.flags = "r";
|
358
|
+
this.mode = 438;
|
359
|
+
this.bufferSize = 64 * 1024;
|
360
|
+
options = options || {};
|
361
|
+
var keys = Object.keys(options);
|
362
|
+
for (var index = 0, length = keys.length; index < length; index++) {
|
363
|
+
var key = keys[index];
|
364
|
+
this[key] = options[key];
|
365
|
+
}
|
366
|
+
if (this.encoding) this.setEncoding(this.encoding);
|
367
|
+
if (this.start !== void 0) {
|
368
|
+
if ("number" !== typeof this.start) {
|
369
|
+
throw TypeError("start must be a Number");
|
370
|
+
}
|
371
|
+
if (this.end === void 0) {
|
372
|
+
this.end = Infinity;
|
373
|
+
} else if ("number" !== typeof this.end) {
|
374
|
+
throw TypeError("end must be a Number");
|
375
|
+
}
|
376
|
+
if (this.start > this.end) {
|
377
|
+
throw new Error("start must be <= end");
|
378
|
+
}
|
379
|
+
this.pos = this.start;
|
380
|
+
}
|
381
|
+
if (this.fd !== null) {
|
382
|
+
process.nextTick(function() {
|
383
|
+
self._read();
|
384
|
+
});
|
385
|
+
return;
|
386
|
+
}
|
387
|
+
fs.open(this.path, this.flags, this.mode, function(err, fd) {
|
388
|
+
if (err) {
|
389
|
+
self.emit("error", err);
|
390
|
+
self.readable = false;
|
391
|
+
return;
|
392
|
+
}
|
393
|
+
self.fd = fd;
|
394
|
+
self.emit("open", fd);
|
395
|
+
self._read();
|
396
|
+
});
|
397
|
+
}
|
398
|
+
function WriteStream(path, options) {
|
399
|
+
if (!(this instanceof WriteStream)) return new WriteStream(path, options);
|
400
|
+
Stream.call(this);
|
401
|
+
this.path = path;
|
402
|
+
this.fd = null;
|
403
|
+
this.writable = true;
|
404
|
+
this.flags = "w";
|
405
|
+
this.encoding = "binary";
|
406
|
+
this.mode = 438;
|
407
|
+
this.bytesWritten = 0;
|
408
|
+
options = options || {};
|
409
|
+
var keys = Object.keys(options);
|
410
|
+
for (var index = 0, length = keys.length; index < length; index++) {
|
411
|
+
var key = keys[index];
|
412
|
+
this[key] = options[key];
|
413
|
+
}
|
414
|
+
if (this.start !== void 0) {
|
415
|
+
if ("number" !== typeof this.start) {
|
416
|
+
throw TypeError("start must be a Number");
|
417
|
+
}
|
418
|
+
if (this.start < 0) {
|
419
|
+
throw new Error("start must be >= zero");
|
420
|
+
}
|
421
|
+
this.pos = this.start;
|
422
|
+
}
|
423
|
+
this.busy = false;
|
424
|
+
this._queue = [];
|
425
|
+
if (this.fd === null) {
|
426
|
+
this._open = fs.open;
|
427
|
+
this._queue.push([this._open, this.path, this.flags, this.mode, void 0]);
|
428
|
+
this.flush();
|
174
429
|
}
|
175
430
|
}
|
176
|
-
};
|
177
|
-
}
|
178
|
-
});
|
179
|
-
var require_make_dir = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
180
|
-
"../../node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/mkdirs/make-dir.js"(exports, module2) {
|
181
|
-
"use strict";
|
182
|
-
var fs = require_fs();
|
183
|
-
var { checkPath } = require_utils();
|
184
|
-
var getMode = (options) => {
|
185
|
-
const defaults = { mode: 511 };
|
186
|
-
if (typeof options === "number") return options;
|
187
|
-
return { ...defaults, ...options }.mode;
|
188
|
-
};
|
189
|
-
module2.exports.makeDir = async (dir, options) => {
|
190
|
-
checkPath(dir);
|
191
|
-
return fs.mkdir(dir, {
|
192
|
-
mode: getMode(options),
|
193
|
-
recursive: true
|
194
|
-
});
|
195
|
-
};
|
196
|
-
module2.exports.makeDirSync = (dir, options) => {
|
197
|
-
checkPath(dir);
|
198
|
-
return fs.mkdirSync(dir, {
|
199
|
-
mode: getMode(options),
|
200
|
-
recursive: true
|
201
|
-
});
|
202
|
-
};
|
203
|
-
}
|
204
|
-
});
|
205
|
-
var require_mkdirs = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
206
|
-
"../../node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/mkdirs/index.js"(exports, module2) {
|
207
|
-
"use strict";
|
208
|
-
var u = require_universalify().fromPromise;
|
209
|
-
var { makeDir: _makeDir, makeDirSync } = require_make_dir();
|
210
|
-
var makeDir = u(_makeDir);
|
211
|
-
module2.exports = {
|
212
|
-
mkdirs: makeDir,
|
213
|
-
mkdirsSync: makeDirSync,
|
214
|
-
// alias
|
215
|
-
mkdirp: makeDir,
|
216
|
-
mkdirpSync: makeDirSync,
|
217
|
-
ensureDir: makeDir,
|
218
|
-
ensureDirSync: makeDirSync
|
219
|
-
};
|
220
|
-
}
|
221
|
-
});
|
222
|
-
var require_path_exists = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
223
|
-
"../../node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/path-exists/index.js"(exports, module2) {
|
224
|
-
"use strict";
|
225
|
-
var u = require_universalify().fromPromise;
|
226
|
-
var fs = require_fs();
|
227
|
-
function pathExists(path) {
|
228
|
-
return fs.access(path).then(() => true).catch(() => false);
|
229
431
|
}
|
230
|
-
module2.exports = {
|
231
|
-
pathExists: u(pathExists),
|
232
|
-
pathExistsSync: fs.existsSync
|
233
|
-
};
|
234
432
|
}
|
235
433
|
});
|
236
|
-
var
|
237
|
-
"../../node_modules/.pnpm/fs
|
434
|
+
var require_clone = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
435
|
+
"../../node_modules/.pnpm/graceful-fs@4.2.11/node_modules/graceful-fs/clone.js"(exports, module2) {
|
238
436
|
"use strict";
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
}
|
437
|
+
module2.exports = clone;
|
438
|
+
var getPrototypeOf = Object.getPrototypeOf || function(obj) {
|
439
|
+
return obj.__proto__;
|
440
|
+
};
|
441
|
+
function clone(obj) {
|
442
|
+
if (obj === null || typeof obj !== "object")
|
443
|
+
return obj;
|
444
|
+
if (obj instanceof Object)
|
445
|
+
var copy = { __proto__: getPrototypeOf(obj) };
|
446
|
+
else
|
447
|
+
var copy = /* @__PURE__ */ Object.create(null);
|
448
|
+
Object.getOwnPropertyNames(obj).forEach(function(key) {
|
449
|
+
Object.defineProperty(copy, key, Object.getOwnPropertyDescriptor(obj, key));
|
248
450
|
});
|
451
|
+
return copy;
|
249
452
|
}
|
250
|
-
function utimesMillisSync(path, atime, mtime) {
|
251
|
-
const fd = fs.openSync(path, "r+");
|
252
|
-
fs.futimesSync(fd, atime, mtime);
|
253
|
-
return fs.closeSync(fd);
|
254
|
-
}
|
255
|
-
module2.exports = {
|
256
|
-
utimesMillis,
|
257
|
-
utimesMillisSync
|
258
|
-
};
|
259
453
|
}
|
260
454
|
});
|
261
|
-
var
|
262
|
-
"../../node_modules/.pnpm/fs
|
455
|
+
var require_graceful_fs = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
456
|
+
"../../node_modules/.pnpm/graceful-fs@4.2.11/node_modules/graceful-fs/graceful-fs.js"(exports, module2) {
|
263
457
|
"use strict";
|
264
|
-
var fs =
|
265
|
-
var
|
458
|
+
var fs = (0, import_chunk_WWAWV7DQ.__require)("fs");
|
459
|
+
var polyfills = require_polyfills();
|
460
|
+
var legacy = require_legacy_streams();
|
461
|
+
var clone = require_clone();
|
266
462
|
var util = (0, import_chunk_WWAWV7DQ.__require)("util");
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
]).then(([srcStat, destStat]) => ({ srcStat, destStat }));
|
463
|
+
var gracefulQueue;
|
464
|
+
var previousSymbol;
|
465
|
+
if (typeof Symbol === "function" && typeof Symbol.for === "function") {
|
466
|
+
gracefulQueue = Symbol.for("graceful-fs.queue");
|
467
|
+
previousSymbol = Symbol.for("graceful-fs.previous");
|
468
|
+
} else {
|
469
|
+
gracefulQueue = "___graceful-fs.queue";
|
470
|
+
previousSymbol = "___graceful-fs.previous";
|
276
471
|
}
|
277
|
-
function
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
472
|
+
function noop() {
|
473
|
+
}
|
474
|
+
function publishQueue(context, queue2) {
|
475
|
+
Object.defineProperty(context, gracefulQueue, {
|
476
|
+
get: function() {
|
477
|
+
return queue2;
|
478
|
+
}
|
479
|
+
});
|
480
|
+
}
|
481
|
+
var debug = noop;
|
482
|
+
if (util.debuglog)
|
483
|
+
debug = util.debuglog("gfs4");
|
484
|
+
else if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || ""))
|
485
|
+
debug = function() {
|
486
|
+
var m = util.format.apply(util, arguments);
|
487
|
+
m = "GFS4: " + m.split(/\n/).join("\nGFS4: ");
|
488
|
+
console.error(m);
|
489
|
+
};
|
490
|
+
if (!fs[gracefulQueue]) {
|
491
|
+
queue = global[gracefulQueue] || [];
|
492
|
+
publishQueue(fs, queue);
|
493
|
+
fs.close = function(fs$close) {
|
494
|
+
function close(fd, cb) {
|
495
|
+
return fs$close.call(fs, fd, function(err) {
|
496
|
+
if (!err) {
|
497
|
+
resetQueue();
|
498
|
+
}
|
499
|
+
if (typeof cb === "function")
|
500
|
+
cb.apply(this, arguments);
|
501
|
+
});
|
502
|
+
}
|
503
|
+
Object.defineProperty(close, previousSymbol, {
|
504
|
+
value: fs$close
|
505
|
+
});
|
506
|
+
return close;
|
507
|
+
}(fs.close);
|
508
|
+
fs.closeSync = function(fs$closeSync) {
|
509
|
+
function closeSync(fd) {
|
510
|
+
fs$closeSync.apply(fs, arguments);
|
511
|
+
resetQueue();
|
512
|
+
}
|
513
|
+
Object.defineProperty(closeSync, previousSymbol, {
|
514
|
+
value: fs$closeSync
|
515
|
+
});
|
516
|
+
return closeSync;
|
517
|
+
}(fs.closeSync);
|
518
|
+
if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || "")) {
|
519
|
+
process.on("exit", function() {
|
520
|
+
debug(fs[gracefulQueue]);
|
521
|
+
(0, import_chunk_WWAWV7DQ.__require)("assert").equal(fs[gracefulQueue].length, 0);
|
522
|
+
});
|
286
523
|
}
|
287
|
-
return { srcStat, destStat };
|
288
524
|
}
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
525
|
+
var queue;
|
526
|
+
if (!global[gracefulQueue]) {
|
527
|
+
publishQueue(global, fs[gracefulQueue]);
|
528
|
+
}
|
529
|
+
module2.exports = patch(clone(fs));
|
530
|
+
if (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH && !fs.__patched) {
|
531
|
+
module2.exports = patch(fs);
|
532
|
+
fs.__patched = true;
|
533
|
+
}
|
534
|
+
function patch(fs2) {
|
535
|
+
polyfills(fs2);
|
536
|
+
fs2.gracefulify = patch;
|
537
|
+
fs2.createReadStream = createReadStream;
|
538
|
+
fs2.createWriteStream = createWriteStream;
|
539
|
+
var fs$readFile = fs2.readFile;
|
540
|
+
fs2.readFile = readFile;
|
541
|
+
function readFile(path, options, cb) {
|
542
|
+
if (typeof options === "function")
|
543
|
+
cb = options, options = null;
|
544
|
+
return go$readFile(path, options, cb);
|
545
|
+
function go$readFile(path2, options2, cb2, startTime) {
|
546
|
+
return fs$readFile(path2, options2, function(err) {
|
547
|
+
if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
|
548
|
+
enqueue([go$readFile, [path2, options2, cb2], err, startTime || Date.now(), Date.now()]);
|
549
|
+
else {
|
550
|
+
if (typeof cb2 === "function")
|
551
|
+
cb2.apply(this, arguments);
|
552
|
+
}
|
553
|
+
});
|
554
|
+
}
|
555
|
+
}
|
556
|
+
var fs$writeFile = fs2.writeFile;
|
557
|
+
fs2.writeFile = writeFile;
|
558
|
+
function writeFile(path, data, options, cb) {
|
559
|
+
if (typeof options === "function")
|
560
|
+
cb = options, options = null;
|
561
|
+
return go$writeFile(path, data, options, cb);
|
562
|
+
function go$writeFile(path2, data2, options2, cb2, startTime) {
|
563
|
+
return fs$writeFile(path2, data2, options2, function(err) {
|
564
|
+
if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
|
565
|
+
enqueue([go$writeFile, [path2, data2, options2, cb2], err, startTime || Date.now(), Date.now()]);
|
566
|
+
else {
|
567
|
+
if (typeof cb2 === "function")
|
568
|
+
cb2.apply(this, arguments);
|
569
|
+
}
|
570
|
+
});
|
571
|
+
}
|
572
|
+
}
|
573
|
+
var fs$appendFile = fs2.appendFile;
|
574
|
+
if (fs$appendFile)
|
575
|
+
fs2.appendFile = appendFile;
|
576
|
+
function appendFile(path, data, options, cb) {
|
577
|
+
if (typeof options === "function")
|
578
|
+
cb = options, options = null;
|
579
|
+
return go$appendFile(path, data, options, cb);
|
580
|
+
function go$appendFile(path2, data2, options2, cb2, startTime) {
|
581
|
+
return fs$appendFile(path2, data2, options2, function(err) {
|
582
|
+
if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
|
583
|
+
enqueue([go$appendFile, [path2, data2, options2, cb2], err, startTime || Date.now(), Date.now()]);
|
584
|
+
else {
|
585
|
+
if (typeof cb2 === "function")
|
586
|
+
cb2.apply(this, arguments);
|
587
|
+
}
|
588
|
+
});
|
589
|
+
}
|
590
|
+
}
|
591
|
+
var fs$copyFile = fs2.copyFile;
|
592
|
+
if (fs$copyFile)
|
593
|
+
fs2.copyFile = copyFile;
|
594
|
+
function copyFile(src, dest, flags, cb) {
|
595
|
+
if (typeof flags === "function") {
|
596
|
+
cb = flags;
|
597
|
+
flags = 0;
|
598
|
+
}
|
599
|
+
return go$copyFile(src, dest, flags, cb);
|
600
|
+
function go$copyFile(src2, dest2, flags2, cb2, startTime) {
|
601
|
+
return fs$copyFile(src2, dest2, flags2, function(err) {
|
602
|
+
if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
|
603
|
+
enqueue([go$copyFile, [src2, dest2, flags2, cb2], err, startTime || Date.now(), Date.now()]);
|
604
|
+
else {
|
605
|
+
if (typeof cb2 === "function")
|
606
|
+
cb2.apply(this, arguments);
|
607
|
+
}
|
608
|
+
});
|
609
|
+
}
|
610
|
+
}
|
611
|
+
var fs$readdir = fs2.readdir;
|
612
|
+
fs2.readdir = readdir;
|
613
|
+
var noReaddirOptionVersions = /^v[0-5]\./;
|
614
|
+
function readdir(path, options, cb) {
|
615
|
+
if (typeof options === "function")
|
616
|
+
cb = options, options = null;
|
617
|
+
var go$readdir = noReaddirOptionVersions.test(process.version) ? function go$readdir2(path2, options2, cb2, startTime) {
|
618
|
+
return fs$readdir(path2, fs$readdirCallback(
|
619
|
+
path2,
|
620
|
+
options2,
|
621
|
+
cb2,
|
622
|
+
startTime
|
623
|
+
));
|
624
|
+
} : function go$readdir2(path2, options2, cb2, startTime) {
|
625
|
+
return fs$readdir(path2, options2, fs$readdirCallback(
|
626
|
+
path2,
|
627
|
+
options2,
|
628
|
+
cb2,
|
629
|
+
startTime
|
630
|
+
));
|
631
|
+
};
|
632
|
+
return go$readdir(path, options, cb);
|
633
|
+
function fs$readdirCallback(path2, options2, cb2, startTime) {
|
634
|
+
return function(err, files) {
|
635
|
+
if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
|
636
|
+
enqueue([
|
637
|
+
go$readdir,
|
638
|
+
[path2, options2, cb2],
|
639
|
+
err,
|
640
|
+
startTime || Date.now(),
|
641
|
+
Date.now()
|
642
|
+
]);
|
643
|
+
else {
|
644
|
+
if (files && files.sort)
|
645
|
+
files.sort();
|
646
|
+
if (typeof cb2 === "function")
|
647
|
+
cb2.call(this, err, files);
|
299
648
|
}
|
300
|
-
|
301
|
-
}
|
302
|
-
if (srcStat.isDirectory() && !destStat.isDirectory()) {
|
303
|
-
return cb(new Error(`Cannot overwrite non-directory '${dest}' with directory '${src}'.`));
|
304
|
-
}
|
305
|
-
if (!srcStat.isDirectory() && destStat.isDirectory()) {
|
306
|
-
return cb(new Error(`Cannot overwrite directory '${dest}' with non-directory '${src}'.`));
|
307
|
-
}
|
308
|
-
}
|
309
|
-
if (srcStat.isDirectory() && isSrcSubdir(src, dest)) {
|
310
|
-
return cb(new Error(errMsg(src, dest, funcName)));
|
311
|
-
}
|
312
|
-
return cb(null, { srcStat, destStat });
|
313
|
-
});
|
314
|
-
}
|
315
|
-
function checkPathsSync(src, dest, funcName, opts) {
|
316
|
-
const { srcStat, destStat } = getStatsSync(src, dest, opts);
|
317
|
-
if (destStat) {
|
318
|
-
if (areIdentical(srcStat, destStat)) {
|
319
|
-
const srcBaseName = path.basename(src);
|
320
|
-
const destBaseName = path.basename(dest);
|
321
|
-
if (funcName === "move" && srcBaseName !== destBaseName && srcBaseName.toLowerCase() === destBaseName.toLowerCase()) {
|
322
|
-
return { srcStat, destStat, isChangingCase: true };
|
323
|
-
}
|
324
|
-
throw new Error("Source and destination must not be the same.");
|
325
|
-
}
|
326
|
-
if (srcStat.isDirectory() && !destStat.isDirectory()) {
|
327
|
-
throw new Error(`Cannot overwrite non-directory '${dest}' with directory '${src}'.`);
|
328
|
-
}
|
329
|
-
if (!srcStat.isDirectory() && destStat.isDirectory()) {
|
330
|
-
throw new Error(`Cannot overwrite directory '${dest}' with non-directory '${src}'.`);
|
331
|
-
}
|
332
|
-
}
|
333
|
-
if (srcStat.isDirectory() && isSrcSubdir(src, dest)) {
|
334
|
-
throw new Error(errMsg(src, dest, funcName));
|
335
|
-
}
|
336
|
-
return { srcStat, destStat };
|
337
|
-
}
|
338
|
-
function checkParentPaths(src, srcStat, dest, funcName, cb) {
|
339
|
-
const srcParent = path.resolve(path.dirname(src));
|
340
|
-
const destParent = path.resolve(path.dirname(dest));
|
341
|
-
if (destParent === srcParent || destParent === path.parse(destParent).root) return cb();
|
342
|
-
fs.stat(destParent, { bigint: true }, (err, destStat) => {
|
343
|
-
if (err) {
|
344
|
-
if (err.code === "ENOENT") return cb();
|
345
|
-
return cb(err);
|
346
|
-
}
|
347
|
-
if (areIdentical(srcStat, destStat)) {
|
348
|
-
return cb(new Error(errMsg(src, dest, funcName)));
|
649
|
+
};
|
349
650
|
}
|
350
|
-
return checkParentPaths(src, srcStat, destParent, funcName, cb);
|
351
|
-
});
|
352
|
-
}
|
353
|
-
function checkParentPathsSync(src, srcStat, dest, funcName) {
|
354
|
-
const srcParent = path.resolve(path.dirname(src));
|
355
|
-
const destParent = path.resolve(path.dirname(dest));
|
356
|
-
if (destParent === srcParent || destParent === path.parse(destParent).root) return;
|
357
|
-
let destStat;
|
358
|
-
try {
|
359
|
-
destStat = fs.statSync(destParent, { bigint: true });
|
360
|
-
} catch (err) {
|
361
|
-
if (err.code === "ENOENT") return;
|
362
|
-
throw err;
|
363
651
|
}
|
364
|
-
if (
|
365
|
-
|
652
|
+
if (process.version.substr(0, 4) === "v0.8") {
|
653
|
+
var legStreams = legacy(fs2);
|
654
|
+
ReadStream = legStreams.ReadStream;
|
655
|
+
WriteStream = legStreams.WriteStream;
|
366
656
|
}
|
367
|
-
|
368
|
-
|
369
|
-
|
370
|
-
|
371
|
-
}
|
372
|
-
function isSrcSubdir(src, dest) {
|
373
|
-
const srcArr = path.resolve(src).split(path.sep).filter((i) => i);
|
374
|
-
const destArr = path.resolve(dest).split(path.sep).filter((i) => i);
|
375
|
-
return srcArr.reduce((acc, cur, i) => acc && destArr[i] === cur, true);
|
376
|
-
}
|
377
|
-
function errMsg(src, dest, funcName) {
|
378
|
-
return `Cannot ${funcName} '${src}' to a subdirectory of itself, '${dest}'.`;
|
379
|
-
}
|
380
|
-
module2.exports = {
|
381
|
-
checkPaths,
|
382
|
-
checkPathsSync,
|
383
|
-
checkParentPaths,
|
384
|
-
checkParentPathsSync,
|
385
|
-
isSrcSubdir,
|
386
|
-
areIdentical
|
387
|
-
};
|
388
|
-
}
|
389
|
-
});
|
390
|
-
var require_copy = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
391
|
-
"../../node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/copy/copy.js"(exports, module2) {
|
392
|
-
"use strict";
|
393
|
-
var fs = (0, import_chunk_H4J2FN2W.require_graceful_fs)();
|
394
|
-
var path = (0, import_chunk_WWAWV7DQ.__require)("path");
|
395
|
-
var mkdirs = require_mkdirs().mkdirs;
|
396
|
-
var pathExists = require_path_exists().pathExists;
|
397
|
-
var utimesMillis = require_utimes().utimesMillis;
|
398
|
-
var stat = require_stat();
|
399
|
-
function copy(src, dest, opts, cb) {
|
400
|
-
if (typeof opts === "function" && !cb) {
|
401
|
-
cb = opts;
|
402
|
-
opts = {};
|
403
|
-
} else if (typeof opts === "function") {
|
404
|
-
opts = { filter: opts };
|
657
|
+
var fs$ReadStream = fs2.ReadStream;
|
658
|
+
if (fs$ReadStream) {
|
659
|
+
ReadStream.prototype = Object.create(fs$ReadStream.prototype);
|
660
|
+
ReadStream.prototype.open = ReadStream$open;
|
405
661
|
}
|
406
|
-
|
407
|
-
|
408
|
-
|
409
|
-
|
410
|
-
opts.overwrite = "overwrite" in opts ? !!opts.overwrite : opts.clobber;
|
411
|
-
if (opts.preserveTimestamps && process.arch === "ia32") {
|
412
|
-
process.emitWarning(
|
413
|
-
"Using the preserveTimestamps option in 32-bit node is not recommended;\n\n see https://github.com/jprichardson/node-fs-extra/issues/269",
|
414
|
-
"Warning",
|
415
|
-
"fs-extra-WARN0001"
|
416
|
-
);
|
662
|
+
var fs$WriteStream = fs2.WriteStream;
|
663
|
+
if (fs$WriteStream) {
|
664
|
+
WriteStream.prototype = Object.create(fs$WriteStream.prototype);
|
665
|
+
WriteStream.prototype.open = WriteStream$open;
|
417
666
|
}
|
418
|
-
|
419
|
-
|
420
|
-
|
421
|
-
|
422
|
-
|
423
|
-
|
424
|
-
|
425
|
-
|
426
|
-
|
427
|
-
});
|
428
|
-
});
|
667
|
+
Object.defineProperty(fs2, "ReadStream", {
|
668
|
+
get: function() {
|
669
|
+
return ReadStream;
|
670
|
+
},
|
671
|
+
set: function(val) {
|
672
|
+
ReadStream = val;
|
673
|
+
},
|
674
|
+
enumerable: true,
|
675
|
+
configurable: true
|
429
676
|
});
|
430
|
-
|
431
|
-
|
432
|
-
|
433
|
-
|
434
|
-
|
435
|
-
|
436
|
-
|
437
|
-
|
438
|
-
|
439
|
-
});
|
677
|
+
Object.defineProperty(fs2, "WriteStream", {
|
678
|
+
get: function() {
|
679
|
+
return WriteStream;
|
680
|
+
},
|
681
|
+
set: function(val) {
|
682
|
+
WriteStream = val;
|
683
|
+
},
|
684
|
+
enumerable: true,
|
685
|
+
configurable: true
|
440
686
|
});
|
441
|
-
|
442
|
-
|
443
|
-
|
444
|
-
|
445
|
-
|
446
|
-
|
447
|
-
|
448
|
-
|
449
|
-
|
450
|
-
|
451
|
-
else if (srcStat.isFile() || srcStat.isCharacterDevice() || srcStat.isBlockDevice()) return onFile(srcStat, destStat, src, dest, opts, cb);
|
452
|
-
else if (srcStat.isSymbolicLink()) return onLink(destStat, src, dest, opts, cb);
|
453
|
-
else if (srcStat.isSocket()) return cb(new Error(`Cannot copy a socket file: ${src}`));
|
454
|
-
else if (srcStat.isFIFO()) return cb(new Error(`Cannot copy a FIFO pipe: ${src}`));
|
455
|
-
return cb(new Error(`Unknown file: ${src}`));
|
687
|
+
var FileReadStream = ReadStream;
|
688
|
+
Object.defineProperty(fs2, "FileReadStream", {
|
689
|
+
get: function() {
|
690
|
+
return FileReadStream;
|
691
|
+
},
|
692
|
+
set: function(val) {
|
693
|
+
FileReadStream = val;
|
694
|
+
},
|
695
|
+
enumerable: true,
|
696
|
+
configurable: true
|
456
697
|
});
|
457
|
-
|
458
|
-
|
459
|
-
|
460
|
-
|
461
|
-
|
462
|
-
|
463
|
-
|
464
|
-
|
465
|
-
|
466
|
-
|
467
|
-
});
|
468
|
-
} else if (opts.errorOnExist) {
|
469
|
-
return cb(new Error(`'${dest}' already exists`));
|
470
|
-
} else return cb();
|
471
|
-
}
|
472
|
-
function copyFile(srcStat, src, dest, opts, cb) {
|
473
|
-
fs.copyFile(src, dest, (err) => {
|
474
|
-
if (err) return cb(err);
|
475
|
-
if (opts.preserveTimestamps) return handleTimestampsAndMode(srcStat.mode, src, dest, cb);
|
476
|
-
return setDestMode(dest, srcStat.mode, cb);
|
698
|
+
var FileWriteStream = WriteStream;
|
699
|
+
Object.defineProperty(fs2, "FileWriteStream", {
|
700
|
+
get: function() {
|
701
|
+
return FileWriteStream;
|
702
|
+
},
|
703
|
+
set: function(val) {
|
704
|
+
FileWriteStream = val;
|
705
|
+
},
|
706
|
+
enumerable: true,
|
707
|
+
configurable: true
|
477
708
|
});
|
478
|
-
|
479
|
-
|
480
|
-
|
481
|
-
|
482
|
-
|
483
|
-
return setDestTimestampsAndMode(srcMode, src, dest, cb);
|
484
|
-
});
|
709
|
+
function ReadStream(path, options) {
|
710
|
+
if (this instanceof ReadStream)
|
711
|
+
return fs$ReadStream.apply(this, arguments), this;
|
712
|
+
else
|
713
|
+
return ReadStream.apply(Object.create(ReadStream.prototype), arguments);
|
485
714
|
}
|
486
|
-
|
487
|
-
|
488
|
-
|
489
|
-
|
490
|
-
|
491
|
-
|
492
|
-
|
493
|
-
|
494
|
-
|
495
|
-
|
496
|
-
|
497
|
-
|
498
|
-
});
|
499
|
-
}
|
500
|
-
function setDestMode(dest, srcMode, cb) {
|
501
|
-
return fs.chmod(dest, srcMode, cb);
|
502
|
-
}
|
503
|
-
function setDestTimestamps(src, dest, cb) {
|
504
|
-
fs.stat(src, (err, updatedSrcStat) => {
|
505
|
-
if (err) return cb(err);
|
506
|
-
return utimesMillis(dest, updatedSrcStat.atime, updatedSrcStat.mtime, cb);
|
507
|
-
});
|
508
|
-
}
|
509
|
-
function onDir(srcStat, destStat, src, dest, opts, cb) {
|
510
|
-
if (!destStat) return mkDirAndCopy(srcStat.mode, src, dest, opts, cb);
|
511
|
-
return copyDir(src, dest, opts, cb);
|
512
|
-
}
|
513
|
-
function mkDirAndCopy(srcMode, src, dest, opts, cb) {
|
514
|
-
fs.mkdir(dest, (err) => {
|
515
|
-
if (err) return cb(err);
|
516
|
-
copyDir(src, dest, opts, (err2) => {
|
517
|
-
if (err2) return cb(err2);
|
518
|
-
return setDestMode(dest, srcMode, cb);
|
715
|
+
function ReadStream$open() {
|
716
|
+
var that = this;
|
717
|
+
open(that.path, that.flags, that.mode, function(err, fd) {
|
718
|
+
if (err) {
|
719
|
+
if (that.autoClose)
|
720
|
+
that.destroy();
|
721
|
+
that.emit("error", err);
|
722
|
+
} else {
|
723
|
+
that.fd = fd;
|
724
|
+
that.emit("open", fd);
|
725
|
+
that.read();
|
726
|
+
}
|
519
727
|
});
|
520
|
-
}
|
521
|
-
|
522
|
-
|
523
|
-
|
524
|
-
|
525
|
-
|
526
|
-
}
|
527
|
-
|
528
|
-
|
529
|
-
|
530
|
-
|
531
|
-
|
532
|
-
|
533
|
-
|
534
|
-
|
535
|
-
|
536
|
-
|
537
|
-
if (err) return cb(err);
|
538
|
-
if (!include) return copyDirItems(items, src, dest, opts, cb);
|
539
|
-
stat.checkPaths(srcItem, destItem, "copy", opts, (err2, stats) => {
|
540
|
-
if (err2) return cb(err2);
|
541
|
-
const { destStat } = stats;
|
542
|
-
getStats(destStat, srcItem, destItem, opts, (err3) => {
|
543
|
-
if (err3) return cb(err3);
|
544
|
-
return copyDirItems(items, src, dest, opts, cb);
|
545
|
-
});
|
728
|
+
}
|
729
|
+
function WriteStream(path, options) {
|
730
|
+
if (this instanceof WriteStream)
|
731
|
+
return fs$WriteStream.apply(this, arguments), this;
|
732
|
+
else
|
733
|
+
return WriteStream.apply(Object.create(WriteStream.prototype), arguments);
|
734
|
+
}
|
735
|
+
function WriteStream$open() {
|
736
|
+
var that = this;
|
737
|
+
open(that.path, that.flags, that.mode, function(err, fd) {
|
738
|
+
if (err) {
|
739
|
+
that.destroy();
|
740
|
+
that.emit("error", err);
|
741
|
+
} else {
|
742
|
+
that.fd = fd;
|
743
|
+
that.emit("open", fd);
|
744
|
+
}
|
546
745
|
});
|
547
|
-
});
|
548
|
-
}
|
549
|
-
function onLink(destStat, src, dest, opts, cb) {
|
550
|
-
fs.readlink(src, (err, resolvedSrc) => {
|
551
|
-
if (err) return cb(err);
|
552
|
-
if (opts.dereference) {
|
553
|
-
resolvedSrc = path.resolve(process.cwd(), resolvedSrc);
|
554
|
-
}
|
555
|
-
if (!destStat) {
|
556
|
-
return fs.symlink(resolvedSrc, dest, cb);
|
557
|
-
} else {
|
558
|
-
fs.readlink(dest, (err2, resolvedDest) => {
|
559
|
-
if (err2) {
|
560
|
-
if (err2.code === "EINVAL" || err2.code === "UNKNOWN") return fs.symlink(resolvedSrc, dest, cb);
|
561
|
-
return cb(err2);
|
562
|
-
}
|
563
|
-
if (opts.dereference) {
|
564
|
-
resolvedDest = path.resolve(process.cwd(), resolvedDest);
|
565
|
-
}
|
566
|
-
if (stat.isSrcSubdir(resolvedSrc, resolvedDest)) {
|
567
|
-
return cb(new Error(`Cannot copy '${resolvedSrc}' to a subdirectory of itself, '${resolvedDest}'.`));
|
568
|
-
}
|
569
|
-
if (stat.isSrcSubdir(resolvedDest, resolvedSrc)) {
|
570
|
-
return cb(new Error(`Cannot overwrite '${resolvedDest}' with '${resolvedSrc}'.`));
|
571
|
-
}
|
572
|
-
return copyLink(resolvedSrc, dest, cb);
|
573
|
-
});
|
574
|
-
}
|
575
|
-
});
|
576
|
-
}
|
577
|
-
function copyLink(resolvedSrc, dest, cb) {
|
578
|
-
fs.unlink(dest, (err) => {
|
579
|
-
if (err) return cb(err);
|
580
|
-
return fs.symlink(resolvedSrc, dest, cb);
|
581
|
-
});
|
582
|
-
}
|
583
|
-
module2.exports = copy;
|
584
|
-
}
|
585
|
-
});
|
586
|
-
var require_copy_sync = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
587
|
-
"../../node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/copy/copy-sync.js"(exports, module2) {
|
588
|
-
"use strict";
|
589
|
-
var fs = (0, import_chunk_H4J2FN2W.require_graceful_fs)();
|
590
|
-
var path = (0, import_chunk_WWAWV7DQ.__require)("path");
|
591
|
-
var mkdirsSync = require_mkdirs().mkdirsSync;
|
592
|
-
var utimesMillisSync = require_utimes().utimesMillisSync;
|
593
|
-
var stat = require_stat();
|
594
|
-
function copySync(src, dest, opts) {
|
595
|
-
if (typeof opts === "function") {
|
596
|
-
opts = { filter: opts };
|
597
746
|
}
|
598
|
-
|
599
|
-
|
600
|
-
|
601
|
-
|
602
|
-
|
603
|
-
|
604
|
-
|
605
|
-
|
606
|
-
|
747
|
+
function createReadStream(path, options) {
|
748
|
+
return new fs2.ReadStream(path, options);
|
749
|
+
}
|
750
|
+
function createWriteStream(path, options) {
|
751
|
+
return new fs2.WriteStream(path, options);
|
752
|
+
}
|
753
|
+
var fs$open = fs2.open;
|
754
|
+
fs2.open = open;
|
755
|
+
function open(path, flags, mode, cb) {
|
756
|
+
if (typeof mode === "function")
|
757
|
+
cb = mode, mode = null;
|
758
|
+
return go$open(path, flags, mode, cb);
|
759
|
+
function go$open(path2, flags2, mode2, cb2, startTime) {
|
760
|
+
return fs$open(path2, flags2, mode2, function(err, fd) {
|
761
|
+
if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
|
762
|
+
enqueue([go$open, [path2, flags2, mode2, cb2], err, startTime || Date.now(), Date.now()]);
|
763
|
+
else {
|
764
|
+
if (typeof cb2 === "function")
|
765
|
+
cb2.apply(this, arguments);
|
766
|
+
}
|
767
|
+
});
|
768
|
+
}
|
607
769
|
}
|
608
|
-
|
609
|
-
stat.checkParentPathsSync(src, srcStat, dest, "copy");
|
610
|
-
if (opts.filter && !opts.filter(src, dest)) return;
|
611
|
-
const destParent = path.dirname(dest);
|
612
|
-
if (!fs.existsSync(destParent)) mkdirsSync(destParent);
|
613
|
-
return getStats(destStat, src, dest, opts);
|
614
|
-
}
|
615
|
-
function getStats(destStat, src, dest, opts) {
|
616
|
-
const statSync = opts.dereference ? fs.statSync : fs.lstatSync;
|
617
|
-
const srcStat = statSync(src);
|
618
|
-
if (srcStat.isDirectory()) return onDir(srcStat, destStat, src, dest, opts);
|
619
|
-
else if (srcStat.isFile() || srcStat.isCharacterDevice() || srcStat.isBlockDevice()) return onFile(srcStat, destStat, src, dest, opts);
|
620
|
-
else if (srcStat.isSymbolicLink()) return onLink(destStat, src, dest, opts);
|
621
|
-
else if (srcStat.isSocket()) throw new Error(`Cannot copy a socket file: ${src}`);
|
622
|
-
else if (srcStat.isFIFO()) throw new Error(`Cannot copy a FIFO pipe: ${src}`);
|
623
|
-
throw new Error(`Unknown file: ${src}`);
|
770
|
+
return fs2;
|
624
771
|
}
|
625
|
-
function
|
626
|
-
|
627
|
-
|
772
|
+
function enqueue(elem) {
|
773
|
+
debug("ENQUEUE", elem[0].name, elem[1]);
|
774
|
+
fs[gracefulQueue].push(elem);
|
775
|
+
retry();
|
628
776
|
}
|
629
|
-
|
630
|
-
|
631
|
-
|
632
|
-
|
633
|
-
|
634
|
-
|
777
|
+
var retryTimer;
|
778
|
+
function resetQueue() {
|
779
|
+
var now = Date.now();
|
780
|
+
for (var i = 0; i < fs[gracefulQueue].length; ++i) {
|
781
|
+
if (fs[gracefulQueue][i].length > 2) {
|
782
|
+
fs[gracefulQueue][i][3] = now;
|
783
|
+
fs[gracefulQueue][i][4] = now;
|
784
|
+
}
|
635
785
|
}
|
786
|
+
retry();
|
636
787
|
}
|
637
|
-
function
|
638
|
-
|
639
|
-
|
640
|
-
|
641
|
-
|
642
|
-
|
643
|
-
|
644
|
-
|
645
|
-
|
646
|
-
|
647
|
-
|
648
|
-
|
649
|
-
|
650
|
-
|
651
|
-
|
652
|
-
|
653
|
-
|
654
|
-
|
655
|
-
|
656
|
-
const updatedSrcStat = fs.statSync(src);
|
657
|
-
return utimesMillisSync(dest, updatedSrcStat.atime, updatedSrcStat.mtime);
|
658
|
-
}
|
659
|
-
function onDir(srcStat, destStat, src, dest, opts) {
|
660
|
-
if (!destStat) return mkDirAndCopy(srcStat.mode, src, dest, opts);
|
661
|
-
return copyDir(src, dest, opts);
|
662
|
-
}
|
663
|
-
function mkDirAndCopy(srcMode, src, dest, opts) {
|
664
|
-
fs.mkdirSync(dest);
|
665
|
-
copyDir(src, dest, opts);
|
666
|
-
return setDestMode(dest, srcMode);
|
667
|
-
}
|
668
|
-
function copyDir(src, dest, opts) {
|
669
|
-
fs.readdirSync(src).forEach((item) => copyDirItem(item, src, dest, opts));
|
670
|
-
}
|
671
|
-
function copyDirItem(item, src, dest, opts) {
|
672
|
-
const srcItem = path.join(src, item);
|
673
|
-
const destItem = path.join(dest, item);
|
674
|
-
if (opts.filter && !opts.filter(srcItem, destItem)) return;
|
675
|
-
const { destStat } = stat.checkPathsSync(srcItem, destItem, "copy", opts);
|
676
|
-
return getStats(destStat, srcItem, destItem, opts);
|
677
|
-
}
|
678
|
-
function onLink(destStat, src, dest, opts) {
|
679
|
-
let resolvedSrc = fs.readlinkSync(src);
|
680
|
-
if (opts.dereference) {
|
681
|
-
resolvedSrc = path.resolve(process.cwd(), resolvedSrc);
|
682
|
-
}
|
683
|
-
if (!destStat) {
|
684
|
-
return fs.symlinkSync(resolvedSrc, dest);
|
788
|
+
function retry() {
|
789
|
+
clearTimeout(retryTimer);
|
790
|
+
retryTimer = void 0;
|
791
|
+
if (fs[gracefulQueue].length === 0)
|
792
|
+
return;
|
793
|
+
var elem = fs[gracefulQueue].shift();
|
794
|
+
var fn = elem[0];
|
795
|
+
var args = elem[1];
|
796
|
+
var err = elem[2];
|
797
|
+
var startTime = elem[3];
|
798
|
+
var lastTime = elem[4];
|
799
|
+
if (startTime === void 0) {
|
800
|
+
debug("RETRY", fn.name, args);
|
801
|
+
fn.apply(null, args);
|
802
|
+
} else if (Date.now() - startTime >= 6e4) {
|
803
|
+
debug("TIMEOUT", fn.name, args);
|
804
|
+
var cb = args.pop();
|
805
|
+
if (typeof cb === "function")
|
806
|
+
cb.call(null, err);
|
685
807
|
} else {
|
686
|
-
|
687
|
-
|
688
|
-
|
689
|
-
|
690
|
-
|
691
|
-
|
692
|
-
}
|
693
|
-
|
694
|
-
resolvedDest = path.resolve(process.cwd(), resolvedDest);
|
695
|
-
}
|
696
|
-
if (stat.isSrcSubdir(resolvedSrc, resolvedDest)) {
|
697
|
-
throw new Error(`Cannot copy '${resolvedSrc}' to a subdirectory of itself, '${resolvedDest}'.`);
|
698
|
-
}
|
699
|
-
if (stat.isSrcSubdir(resolvedDest, resolvedSrc)) {
|
700
|
-
throw new Error(`Cannot overwrite '${resolvedDest}' with '${resolvedSrc}'.`);
|
808
|
+
var sinceAttempt = Date.now() - lastTime;
|
809
|
+
var sinceStart = Math.max(lastTime - startTime, 1);
|
810
|
+
var desiredDelay = Math.min(sinceStart * 1.2, 100);
|
811
|
+
if (sinceAttempt >= desiredDelay) {
|
812
|
+
debug("RETRY", fn.name, args);
|
813
|
+
fn.apply(null, args.concat([startTime]));
|
814
|
+
} else {
|
815
|
+
fs[gracefulQueue].push(elem);
|
701
816
|
}
|
702
|
-
|
817
|
+
}
|
818
|
+
if (retryTimer === void 0) {
|
819
|
+
retryTimer = setTimeout(retry, 0);
|
703
820
|
}
|
704
821
|
}
|
705
|
-
function copyLink(resolvedSrc, dest) {
|
706
|
-
fs.unlinkSync(dest);
|
707
|
-
return fs.symlinkSync(resolvedSrc, dest);
|
708
|
-
}
|
709
|
-
module2.exports = copySync;
|
710
822
|
}
|
711
823
|
});
|
712
|
-
var
|
713
|
-
"../../node_modules/.pnpm/fs-extra@11.
|
824
|
+
var require_fs = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
825
|
+
"../../node_modules/.pnpm/fs-extra@11.3.0/node_modules/fs-extra/lib/fs/index.js"(exports) {
|
714
826
|
"use strict";
|
715
827
|
var u = require_universalify().fromCallback;
|
716
|
-
|
717
|
-
|
718
|
-
|
828
|
+
var fs = require_graceful_fs();
|
829
|
+
var api = [
|
830
|
+
"access",
|
831
|
+
"appendFile",
|
832
|
+
"chmod",
|
833
|
+
"chown",
|
834
|
+
"close",
|
835
|
+
"copyFile",
|
836
|
+
"cp",
|
837
|
+
"fchmod",
|
838
|
+
"fchown",
|
839
|
+
"fdatasync",
|
840
|
+
"fstat",
|
841
|
+
"fsync",
|
842
|
+
"ftruncate",
|
843
|
+
"futimes",
|
844
|
+
"glob",
|
845
|
+
"lchmod",
|
846
|
+
"lchown",
|
847
|
+
"lutimes",
|
848
|
+
"link",
|
849
|
+
"lstat",
|
850
|
+
"mkdir",
|
851
|
+
"mkdtemp",
|
852
|
+
"open",
|
853
|
+
"opendir",
|
854
|
+
"readdir",
|
855
|
+
"readFile",
|
856
|
+
"readlink",
|
857
|
+
"realpath",
|
858
|
+
"rename",
|
859
|
+
"rm",
|
860
|
+
"rmdir",
|
861
|
+
"stat",
|
862
|
+
"statfs",
|
863
|
+
"symlink",
|
864
|
+
"truncate",
|
865
|
+
"unlink",
|
866
|
+
"utimes",
|
867
|
+
"writeFile"
|
868
|
+
].filter((key) => {
|
869
|
+
return typeof fs[key] === "function";
|
870
|
+
});
|
871
|
+
Object.assign(exports, fs);
|
872
|
+
api.forEach((method) => {
|
873
|
+
exports[method] = u(fs[method]);
|
874
|
+
});
|
875
|
+
exports.exists = function(filename, callback) {
|
876
|
+
if (typeof callback === "function") {
|
877
|
+
return fs.exists(filename, callback);
|
878
|
+
}
|
879
|
+
return new Promise((resolve) => {
|
880
|
+
return fs.exists(filename, resolve);
|
881
|
+
});
|
719
882
|
};
|
720
|
-
|
721
|
-
|
722
|
-
|
723
|
-
|
724
|
-
|
725
|
-
|
726
|
-
|
727
|
-
|
728
|
-
|
729
|
-
|
730
|
-
function removeSync(path) {
|
731
|
-
fs.rmSync(path, { recursive: true, force: true });
|
732
|
-
}
|
733
|
-
module2.exports = {
|
734
|
-
remove: u(remove),
|
735
|
-
removeSync
|
883
|
+
exports.read = function(fd, buffer, offset, length, position, callback) {
|
884
|
+
if (typeof callback === "function") {
|
885
|
+
return fs.read(fd, buffer, offset, length, position, callback);
|
886
|
+
}
|
887
|
+
return new Promise((resolve, reject) => {
|
888
|
+
fs.read(fd, buffer, offset, length, position, (err, bytesRead, buffer2) => {
|
889
|
+
if (err) return reject(err);
|
890
|
+
resolve({ bytesRead, buffer: buffer2 });
|
891
|
+
});
|
892
|
+
});
|
736
893
|
};
|
737
|
-
|
738
|
-
|
739
|
-
|
740
|
-
"../../node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/empty/index.js"(exports, module2) {
|
741
|
-
"use strict";
|
742
|
-
var u = require_universalify().fromPromise;
|
743
|
-
var fs = require_fs();
|
744
|
-
var path = (0, import_chunk_WWAWV7DQ.__require)("path");
|
745
|
-
var mkdir = require_mkdirs();
|
746
|
-
var remove = require_remove();
|
747
|
-
var emptyDir = u(async function emptyDir2(dir) {
|
748
|
-
let items;
|
749
|
-
try {
|
750
|
-
items = await fs.readdir(dir);
|
751
|
-
} catch {
|
752
|
-
return mkdir.mkdirs(dir);
|
894
|
+
exports.write = function(fd, buffer, ...args) {
|
895
|
+
if (typeof args[args.length - 1] === "function") {
|
896
|
+
return fs.write(fd, buffer, ...args);
|
753
897
|
}
|
754
|
-
return Promise
|
755
|
-
|
756
|
-
|
757
|
-
|
758
|
-
|
759
|
-
|
760
|
-
|
761
|
-
|
898
|
+
return new Promise((resolve, reject) => {
|
899
|
+
fs.write(fd, buffer, ...args, (err, bytesWritten, buffer2) => {
|
900
|
+
if (err) return reject(err);
|
901
|
+
resolve({ bytesWritten, buffer: buffer2 });
|
902
|
+
});
|
903
|
+
});
|
904
|
+
};
|
905
|
+
exports.readv = function(fd, buffers, ...args) {
|
906
|
+
if (typeof args[args.length - 1] === "function") {
|
907
|
+
return fs.readv(fd, buffers, ...args);
|
908
|
+
}
|
909
|
+
return new Promise((resolve, reject) => {
|
910
|
+
fs.readv(fd, buffers, ...args, (err, bytesRead, buffers2) => {
|
911
|
+
if (err) return reject(err);
|
912
|
+
resolve({ bytesRead, buffers: buffers2 });
|
913
|
+
});
|
914
|
+
});
|
915
|
+
};
|
916
|
+
exports.writev = function(fd, buffers, ...args) {
|
917
|
+
if (typeof args[args.length - 1] === "function") {
|
918
|
+
return fs.writev(fd, buffers, ...args);
|
762
919
|
}
|
763
|
-
|
764
|
-
|
765
|
-
|
920
|
+
return new Promise((resolve, reject) => {
|
921
|
+
fs.writev(fd, buffers, ...args, (err, bytesWritten, buffers2) => {
|
922
|
+
if (err) return reject(err);
|
923
|
+
resolve({ bytesWritten, buffers: buffers2 });
|
924
|
+
});
|
766
925
|
});
|
767
|
-
}
|
768
|
-
module2.exports = {
|
769
|
-
emptyDirSync,
|
770
|
-
emptydirSync: emptyDirSync,
|
771
|
-
emptyDir,
|
772
|
-
emptydir: emptyDir
|
773
926
|
};
|
927
|
+
if (typeof fs.realpath.native === "function") {
|
928
|
+
exports.realpath.native = u(fs.realpath.native);
|
929
|
+
} else {
|
930
|
+
process.emitWarning(
|
931
|
+
"fs.realpath.native is not a function. Is fs being monkey-patched?",
|
932
|
+
"Warning",
|
933
|
+
"fs-extra-WARN0003"
|
934
|
+
);
|
935
|
+
}
|
774
936
|
}
|
775
937
|
});
|
776
|
-
var
|
777
|
-
"../../node_modules/.pnpm/fs-extra@11.
|
938
|
+
var require_utils = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
939
|
+
"../../node_modules/.pnpm/fs-extra@11.3.0/node_modules/fs-extra/lib/mkdirs/utils.js"(exports, module2) {
|
778
940
|
"use strict";
|
779
|
-
var u = require_universalify().fromCallback;
|
780
941
|
var path = (0, import_chunk_WWAWV7DQ.__require)("path");
|
781
|
-
|
782
|
-
|
783
|
-
|
784
|
-
|
785
|
-
|
786
|
-
|
787
|
-
|
788
|
-
});
|
789
|
-
}
|
790
|
-
fs.stat(file, (err, stats) => {
|
791
|
-
if (!err && stats.isFile()) return callback();
|
792
|
-
const dir = path.dirname(file);
|
793
|
-
fs.stat(dir, (err2, stats2) => {
|
794
|
-
if (err2) {
|
795
|
-
if (err2.code === "ENOENT") {
|
796
|
-
return mkdir.mkdirs(dir, (err3) => {
|
797
|
-
if (err3) return callback(err3);
|
798
|
-
makeFile();
|
799
|
-
});
|
800
|
-
}
|
801
|
-
return callback(err2);
|
802
|
-
}
|
803
|
-
if (stats2.isDirectory()) makeFile();
|
804
|
-
else {
|
805
|
-
fs.readdir(dir, (err3) => {
|
806
|
-
if (err3) return callback(err3);
|
807
|
-
});
|
808
|
-
}
|
809
|
-
});
|
810
|
-
});
|
811
|
-
}
|
812
|
-
function createFileSync(file) {
|
813
|
-
let stats;
|
814
|
-
try {
|
815
|
-
stats = fs.statSync(file);
|
816
|
-
} catch {
|
817
|
-
}
|
818
|
-
if (stats && stats.isFile()) return;
|
819
|
-
const dir = path.dirname(file);
|
820
|
-
try {
|
821
|
-
if (!fs.statSync(dir).isDirectory()) {
|
822
|
-
fs.readdirSync(dir);
|
942
|
+
module2.exports.checkPath = function checkPath(pth) {
|
943
|
+
if (process.platform === "win32") {
|
944
|
+
const pathHasInvalidWinCharacters = /[<>:"|?*]/.test(pth.replace(path.parse(pth).root, ""));
|
945
|
+
if (pathHasInvalidWinCharacters) {
|
946
|
+
const error = new Error(`Path contains invalid characters: ${pth}`);
|
947
|
+
error.code = "EINVAL";
|
948
|
+
throw error;
|
823
949
|
}
|
824
|
-
} catch (err) {
|
825
|
-
if (err && err.code === "ENOENT") mkdir.mkdirsSync(dir);
|
826
|
-
else throw err;
|
827
950
|
}
|
828
|
-
fs.writeFileSync(file, "");
|
829
|
-
}
|
830
|
-
module2.exports = {
|
831
|
-
createFile: u(createFile),
|
832
|
-
createFileSync
|
833
951
|
};
|
834
952
|
}
|
835
953
|
});
|
836
|
-
var
|
837
|
-
"../../node_modules/.pnpm/fs-extra@11.
|
954
|
+
var require_make_dir = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
955
|
+
"../../node_modules/.pnpm/fs-extra@11.3.0/node_modules/fs-extra/lib/mkdirs/make-dir.js"(exports, module2) {
|
838
956
|
"use strict";
|
839
|
-
var
|
840
|
-
var
|
841
|
-
var
|
842
|
-
|
843
|
-
|
844
|
-
|
845
|
-
|
846
|
-
|
847
|
-
|
848
|
-
|
849
|
-
|
850
|
-
|
851
|
-
}
|
852
|
-
|
853
|
-
|
854
|
-
|
855
|
-
|
856
|
-
|
857
|
-
|
858
|
-
if (dstStat && areIdentical(srcStat, dstStat)) return callback(null);
|
859
|
-
const dir = path.dirname(dstpath);
|
860
|
-
pathExists(dir, (err2, dirExists) => {
|
861
|
-
if (err2) return callback(err2);
|
862
|
-
if (dirExists) return makeLink(srcpath, dstpath);
|
863
|
-
mkdir.mkdirs(dir, (err3) => {
|
864
|
-
if (err3) return callback(err3);
|
865
|
-
makeLink(srcpath, dstpath);
|
866
|
-
});
|
867
|
-
});
|
868
|
-
});
|
957
|
+
var fs = require_fs();
|
958
|
+
var { checkPath } = require_utils();
|
959
|
+
var getMode = (options) => {
|
960
|
+
const defaults = { mode: 511 };
|
961
|
+
if (typeof options === "number") return options;
|
962
|
+
return { ...defaults, ...options }.mode;
|
963
|
+
};
|
964
|
+
module2.exports.makeDir = async (dir, options) => {
|
965
|
+
checkPath(dir);
|
966
|
+
return fs.mkdir(dir, {
|
967
|
+
mode: getMode(options),
|
968
|
+
recursive: true
|
969
|
+
});
|
970
|
+
};
|
971
|
+
module2.exports.makeDirSync = (dir, options) => {
|
972
|
+
checkPath(dir);
|
973
|
+
return fs.mkdirSync(dir, {
|
974
|
+
mode: getMode(options),
|
975
|
+
recursive: true
|
869
976
|
});
|
870
|
-
}
|
871
|
-
function createLinkSync(srcpath, dstpath) {
|
872
|
-
let dstStat;
|
873
|
-
try {
|
874
|
-
dstStat = fs.lstatSync(dstpath);
|
875
|
-
} catch {
|
876
|
-
}
|
877
|
-
try {
|
878
|
-
const srcStat = fs.lstatSync(srcpath);
|
879
|
-
if (dstStat && areIdentical(srcStat, dstStat)) return;
|
880
|
-
} catch (err) {
|
881
|
-
err.message = err.message.replace("lstat", "ensureLink");
|
882
|
-
throw err;
|
883
|
-
}
|
884
|
-
const dir = path.dirname(dstpath);
|
885
|
-
const dirExists = fs.existsSync(dir);
|
886
|
-
if (dirExists) return fs.linkSync(srcpath, dstpath);
|
887
|
-
mkdir.mkdirsSync(dir);
|
888
|
-
return fs.linkSync(srcpath, dstpath);
|
889
|
-
}
|
890
|
-
module2.exports = {
|
891
|
-
createLink: u(createLink),
|
892
|
-
createLinkSync
|
893
977
|
};
|
894
978
|
}
|
895
979
|
});
|
896
|
-
var
|
897
|
-
"../../node_modules/.pnpm/fs-extra@11.
|
980
|
+
var require_mkdirs = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
981
|
+
"../../node_modules/.pnpm/fs-extra@11.3.0/node_modules/fs-extra/lib/mkdirs/index.js"(exports, module2) {
|
898
982
|
"use strict";
|
899
|
-
var
|
900
|
-
var
|
901
|
-
var
|
902
|
-
function symlinkPaths(srcpath, dstpath, callback) {
|
903
|
-
if (path.isAbsolute(srcpath)) {
|
904
|
-
return fs.lstat(srcpath, (err) => {
|
905
|
-
if (err) {
|
906
|
-
err.message = err.message.replace("lstat", "ensureSymlink");
|
907
|
-
return callback(err);
|
908
|
-
}
|
909
|
-
return callback(null, {
|
910
|
-
toCwd: srcpath,
|
911
|
-
toDst: srcpath
|
912
|
-
});
|
913
|
-
});
|
914
|
-
} else {
|
915
|
-
const dstdir = path.dirname(dstpath);
|
916
|
-
const relativeToDst = path.join(dstdir, srcpath);
|
917
|
-
return pathExists(relativeToDst, (err, exists) => {
|
918
|
-
if (err) return callback(err);
|
919
|
-
if (exists) {
|
920
|
-
return callback(null, {
|
921
|
-
toCwd: relativeToDst,
|
922
|
-
toDst: srcpath
|
923
|
-
});
|
924
|
-
} else {
|
925
|
-
return fs.lstat(srcpath, (err2) => {
|
926
|
-
if (err2) {
|
927
|
-
err2.message = err2.message.replace("lstat", "ensureSymlink");
|
928
|
-
return callback(err2);
|
929
|
-
}
|
930
|
-
return callback(null, {
|
931
|
-
toCwd: srcpath,
|
932
|
-
toDst: path.relative(dstdir, srcpath)
|
933
|
-
});
|
934
|
-
});
|
935
|
-
}
|
936
|
-
});
|
937
|
-
}
|
938
|
-
}
|
939
|
-
function symlinkPathsSync(srcpath, dstpath) {
|
940
|
-
let exists;
|
941
|
-
if (path.isAbsolute(srcpath)) {
|
942
|
-
exists = fs.existsSync(srcpath);
|
943
|
-
if (!exists) throw new Error("absolute srcpath does not exist");
|
944
|
-
return {
|
945
|
-
toCwd: srcpath,
|
946
|
-
toDst: srcpath
|
947
|
-
};
|
948
|
-
} else {
|
949
|
-
const dstdir = path.dirname(dstpath);
|
950
|
-
const relativeToDst = path.join(dstdir, srcpath);
|
951
|
-
exists = fs.existsSync(relativeToDst);
|
952
|
-
if (exists) {
|
953
|
-
return {
|
954
|
-
toCwd: relativeToDst,
|
955
|
-
toDst: srcpath
|
956
|
-
};
|
957
|
-
} else {
|
958
|
-
exists = fs.existsSync(srcpath);
|
959
|
-
if (!exists) throw new Error("relative srcpath does not exist");
|
960
|
-
return {
|
961
|
-
toCwd: srcpath,
|
962
|
-
toDst: path.relative(dstdir, srcpath)
|
963
|
-
};
|
964
|
-
}
|
965
|
-
}
|
966
|
-
}
|
983
|
+
var u = require_universalify().fromPromise;
|
984
|
+
var { makeDir: _makeDir, makeDirSync } = require_make_dir();
|
985
|
+
var makeDir = u(_makeDir);
|
967
986
|
module2.exports = {
|
968
|
-
|
969
|
-
|
987
|
+
mkdirs: makeDir,
|
988
|
+
mkdirsSync: makeDirSync,
|
989
|
+
// alias
|
990
|
+
mkdirp: makeDir,
|
991
|
+
mkdirpSync: makeDirSync,
|
992
|
+
ensureDir: makeDir,
|
993
|
+
ensureDirSync: makeDirSync
|
970
994
|
};
|
971
995
|
}
|
972
996
|
});
|
973
|
-
var
|
974
|
-
"../../node_modules/.pnpm/fs-extra@11.
|
997
|
+
var require_path_exists = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
998
|
+
"../../node_modules/.pnpm/fs-extra@11.3.0/node_modules/fs-extra/lib/path-exists/index.js"(exports, module2) {
|
975
999
|
"use strict";
|
976
|
-
var
|
977
|
-
|
978
|
-
|
979
|
-
|
980
|
-
if (type) return callback(null, type);
|
981
|
-
fs.lstat(srcpath, (err, stats) => {
|
982
|
-
if (err) return callback(null, "file");
|
983
|
-
type = stats && stats.isDirectory() ? "dir" : "file";
|
984
|
-
callback(null, type);
|
985
|
-
});
|
986
|
-
}
|
987
|
-
function symlinkTypeSync(srcpath, type) {
|
988
|
-
let stats;
|
989
|
-
if (type) return type;
|
990
|
-
try {
|
991
|
-
stats = fs.lstatSync(srcpath);
|
992
|
-
} catch {
|
993
|
-
return "file";
|
994
|
-
}
|
995
|
-
return stats && stats.isDirectory() ? "dir" : "file";
|
1000
|
+
var u = require_universalify().fromPromise;
|
1001
|
+
var fs = require_fs();
|
1002
|
+
function pathExists(path) {
|
1003
|
+
return fs.access(path).then(() => true).catch(() => false);
|
996
1004
|
}
|
997
1005
|
module2.exports = {
|
998
|
-
|
999
|
-
|
1006
|
+
pathExists: u(pathExists),
|
1007
|
+
pathExistsSync: fs.existsSync
|
1000
1008
|
};
|
1001
1009
|
}
|
1002
1010
|
});
|
1003
|
-
var
|
1004
|
-
"../../node_modules/.pnpm/fs-extra@11.
|
1011
|
+
var require_utimes = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
1012
|
+
"../../node_modules/.pnpm/fs-extra@11.3.0/node_modules/fs-extra/lib/util/utimes.js"(exports, module2) {
|
1005
1013
|
"use strict";
|
1006
|
-
var u = require_universalify().fromCallback;
|
1007
|
-
var path = (0, import_chunk_WWAWV7DQ.__require)("path");
|
1008
1014
|
var fs = require_fs();
|
1009
|
-
var
|
1010
|
-
|
1011
|
-
|
1012
|
-
|
1013
|
-
var symlinkPaths = _symlinkPaths.symlinkPaths;
|
1014
|
-
var symlinkPathsSync = _symlinkPaths.symlinkPathsSync;
|
1015
|
-
var _symlinkType = require_symlink_type();
|
1016
|
-
var symlinkType = _symlinkType.symlinkType;
|
1017
|
-
var symlinkTypeSync = _symlinkType.symlinkTypeSync;
|
1018
|
-
var pathExists = require_path_exists().pathExists;
|
1019
|
-
var { areIdentical } = require_stat();
|
1020
|
-
function createSymlink(srcpath, dstpath, type, callback) {
|
1021
|
-
callback = typeof type === "function" ? type : callback;
|
1022
|
-
type = typeof type === "function" ? false : type;
|
1023
|
-
fs.lstat(dstpath, (err, stats) => {
|
1024
|
-
if (!err && stats.isSymbolicLink()) {
|
1025
|
-
Promise.all([
|
1026
|
-
fs.stat(srcpath),
|
1027
|
-
fs.stat(dstpath)
|
1028
|
-
]).then(([srcStat, dstStat]) => {
|
1029
|
-
if (areIdentical(srcStat, dstStat)) return callback(null);
|
1030
|
-
_createSymlink(srcpath, dstpath, type, callback);
|
1031
|
-
});
|
1032
|
-
} else _createSymlink(srcpath, dstpath, type, callback);
|
1033
|
-
});
|
1034
|
-
}
|
1035
|
-
function _createSymlink(srcpath, dstpath, type, callback) {
|
1036
|
-
symlinkPaths(srcpath, dstpath, (err, relative) => {
|
1037
|
-
if (err) return callback(err);
|
1038
|
-
srcpath = relative.toDst;
|
1039
|
-
symlinkType(relative.toCwd, type, (err2, type2) => {
|
1040
|
-
if (err2) return callback(err2);
|
1041
|
-
const dir = path.dirname(dstpath);
|
1042
|
-
pathExists(dir, (err3, dirExists) => {
|
1043
|
-
if (err3) return callback(err3);
|
1044
|
-
if (dirExists) return fs.symlink(srcpath, dstpath, type2, callback);
|
1045
|
-
mkdirs(dir, (err4) => {
|
1046
|
-
if (err4) return callback(err4);
|
1047
|
-
fs.symlink(srcpath, dstpath, type2, callback);
|
1048
|
-
});
|
1049
|
-
});
|
1050
|
-
});
|
1051
|
-
});
|
1052
|
-
}
|
1053
|
-
function createSymlinkSync(srcpath, dstpath, type) {
|
1054
|
-
let stats;
|
1015
|
+
var u = require_universalify().fromPromise;
|
1016
|
+
async function utimesMillis(path, atime, mtime) {
|
1017
|
+
const fd = await fs.open(path, "r+");
|
1018
|
+
let closeErr = null;
|
1055
1019
|
try {
|
1056
|
-
|
1057
|
-
}
|
1020
|
+
await fs.futimes(fd, atime, mtime);
|
1021
|
+
} finally {
|
1022
|
+
try {
|
1023
|
+
await fs.close(fd);
|
1024
|
+
} catch (e) {
|
1025
|
+
closeErr = e;
|
1026
|
+
}
|
1058
1027
|
}
|
1059
|
-
if (
|
1060
|
-
|
1061
|
-
const dstStat = fs.statSync(dstpath);
|
1062
|
-
if (areIdentical(srcStat, dstStat)) return;
|
1028
|
+
if (closeErr) {
|
1029
|
+
throw closeErr;
|
1063
1030
|
}
|
1064
|
-
const relative = symlinkPathsSync(srcpath, dstpath);
|
1065
|
-
srcpath = relative.toDst;
|
1066
|
-
type = symlinkTypeSync(relative.toCwd, type);
|
1067
|
-
const dir = path.dirname(dstpath);
|
1068
|
-
const exists = fs.existsSync(dir);
|
1069
|
-
if (exists) return fs.symlinkSync(srcpath, dstpath, type);
|
1070
|
-
mkdirsSync(dir);
|
1071
|
-
return fs.symlinkSync(srcpath, dstpath, type);
|
1072
1031
|
}
|
1073
|
-
|
1074
|
-
|
1075
|
-
|
1076
|
-
|
1077
|
-
|
1078
|
-
|
1079
|
-
|
1080
|
-
|
1081
|
-
"use strict";
|
1082
|
-
var { createFile, createFileSync } = require_file();
|
1083
|
-
var { createLink, createLinkSync } = require_link();
|
1084
|
-
var { createSymlink, createSymlinkSync } = require_symlink();
|
1085
|
-
module2.exports = {
|
1086
|
-
// file
|
1087
|
-
createFile,
|
1088
|
-
createFileSync,
|
1089
|
-
ensureFile: createFile,
|
1090
|
-
ensureFileSync: createFileSync,
|
1091
|
-
// link
|
1092
|
-
createLink,
|
1093
|
-
createLinkSync,
|
1094
|
-
ensureLink: createLink,
|
1095
|
-
ensureLinkSync: createLinkSync,
|
1096
|
-
// symlink
|
1097
|
-
createSymlink,
|
1098
|
-
createSymlinkSync,
|
1099
|
-
ensureSymlink: createSymlink,
|
1100
|
-
ensureSymlinkSync: createSymlinkSync
|
1032
|
+
function utimesMillisSync(path, atime, mtime) {
|
1033
|
+
const fd = fs.openSync(path, "r+");
|
1034
|
+
fs.futimesSync(fd, atime, mtime);
|
1035
|
+
return fs.closeSync(fd);
|
1036
|
+
}
|
1037
|
+
module2.exports = {
|
1038
|
+
utimesMillis: u(utimesMillis),
|
1039
|
+
utimesMillisSync
|
1101
1040
|
};
|
1102
1041
|
}
|
1103
1042
|
});
|
1104
|
-
var
|
1105
|
-
"../../node_modules/.pnpm/
|
1043
|
+
var require_stat = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
1044
|
+
"../../node_modules/.pnpm/fs-extra@11.3.0/node_modules/fs-extra/lib/util/stat.js"(exports, module2) {
|
1106
1045
|
"use strict";
|
1107
|
-
var
|
1108
|
-
var
|
1109
|
-
var
|
1110
|
-
|
1111
|
-
|
1112
|
-
|
1113
|
-
|
1114
|
-
|
1115
|
-
|
1116
|
-
|
1117
|
-
|
1118
|
-
|
1119
|
-
}
|
1120
|
-
if (typeof process.chdir === "function") {
|
1121
|
-
chdir = process.chdir;
|
1122
|
-
process.chdir = function(d) {
|
1123
|
-
cwd = null;
|
1124
|
-
chdir.call(process, d);
|
1125
|
-
};
|
1126
|
-
if (Object.setPrototypeOf) Object.setPrototypeOf(process.chdir, chdir);
|
1046
|
+
var fs = require_fs();
|
1047
|
+
var path = (0, import_chunk_WWAWV7DQ.__require)("path");
|
1048
|
+
var u = require_universalify().fromPromise;
|
1049
|
+
function getStats(src, dest, opts) {
|
1050
|
+
const statFunc = opts.dereference ? (file) => fs.stat(file, { bigint: true }) : (file) => fs.lstat(file, { bigint: true });
|
1051
|
+
return Promise.all([
|
1052
|
+
statFunc(src),
|
1053
|
+
statFunc(dest).catch((err) => {
|
1054
|
+
if (err.code === "ENOENT") return null;
|
1055
|
+
throw err;
|
1056
|
+
})
|
1057
|
+
]).then(([srcStat, destStat]) => ({ srcStat, destStat }));
|
1127
1058
|
}
|
1128
|
-
|
1129
|
-
|
1130
|
-
|
1131
|
-
|
1132
|
-
|
1133
|
-
|
1134
|
-
|
1135
|
-
|
1136
|
-
|
1137
|
-
fs.chown = chownFix(fs.chown);
|
1138
|
-
fs.fchown = chownFix(fs.fchown);
|
1139
|
-
fs.lchown = chownFix(fs.lchown);
|
1140
|
-
fs.chmod = chmodFix(fs.chmod);
|
1141
|
-
fs.fchmod = chmodFix(fs.fchmod);
|
1142
|
-
fs.lchmod = chmodFix(fs.lchmod);
|
1143
|
-
fs.chownSync = chownFixSync(fs.chownSync);
|
1144
|
-
fs.fchownSync = chownFixSync(fs.fchownSync);
|
1145
|
-
fs.lchownSync = chownFixSync(fs.lchownSync);
|
1146
|
-
fs.chmodSync = chmodFixSync(fs.chmodSync);
|
1147
|
-
fs.fchmodSync = chmodFixSync(fs.fchmodSync);
|
1148
|
-
fs.lchmodSync = chmodFixSync(fs.lchmodSync);
|
1149
|
-
fs.stat = statFix(fs.stat);
|
1150
|
-
fs.fstat = statFix(fs.fstat);
|
1151
|
-
fs.lstat = statFix(fs.lstat);
|
1152
|
-
fs.statSync = statFixSync(fs.statSync);
|
1153
|
-
fs.fstatSync = statFixSync(fs.fstatSync);
|
1154
|
-
fs.lstatSync = statFixSync(fs.lstatSync);
|
1155
|
-
if (fs.chmod && !fs.lchmod) {
|
1156
|
-
fs.lchmod = function(path, mode, cb) {
|
1157
|
-
if (cb) process.nextTick(cb);
|
1158
|
-
};
|
1159
|
-
fs.lchmodSync = function() {
|
1160
|
-
};
|
1161
|
-
}
|
1162
|
-
if (fs.chown && !fs.lchown) {
|
1163
|
-
fs.lchown = function(path, uid, gid, cb) {
|
1164
|
-
if (cb) process.nextTick(cb);
|
1165
|
-
};
|
1166
|
-
fs.lchownSync = function() {
|
1167
|
-
};
|
1168
|
-
}
|
1169
|
-
if (platform === "win32") {
|
1170
|
-
fs.rename = typeof fs.rename !== "function" ? fs.rename : function(fs$rename) {
|
1171
|
-
function rename(from, to, cb) {
|
1172
|
-
var start = Date.now();
|
1173
|
-
var backoff = 0;
|
1174
|
-
fs$rename(from, to, function CB(er) {
|
1175
|
-
if (er && (er.code === "EACCES" || er.code === "EPERM" || er.code === "EBUSY") && Date.now() - start < 6e4) {
|
1176
|
-
setTimeout(function() {
|
1177
|
-
fs.stat(to, function(stater, st) {
|
1178
|
-
if (stater && stater.code === "ENOENT")
|
1179
|
-
fs$rename(from, to, CB);
|
1180
|
-
else
|
1181
|
-
cb(er);
|
1182
|
-
});
|
1183
|
-
}, backoff);
|
1184
|
-
if (backoff < 100)
|
1185
|
-
backoff += 10;
|
1186
|
-
return;
|
1187
|
-
}
|
1188
|
-
if (cb) cb(er);
|
1189
|
-
});
|
1190
|
-
}
|
1191
|
-
if (Object.setPrototypeOf) Object.setPrototypeOf(rename, fs$rename);
|
1192
|
-
return rename;
|
1193
|
-
}(fs.rename);
|
1059
|
+
function getStatsSync(src, dest, opts) {
|
1060
|
+
let destStat;
|
1061
|
+
const statFunc = opts.dereference ? (file) => fs.statSync(file, { bigint: true }) : (file) => fs.lstatSync(file, { bigint: true });
|
1062
|
+
const srcStat = statFunc(src);
|
1063
|
+
try {
|
1064
|
+
destStat = statFunc(dest);
|
1065
|
+
} catch (err) {
|
1066
|
+
if (err.code === "ENOENT") return { srcStat, destStat: null };
|
1067
|
+
throw err;
|
1194
1068
|
}
|
1195
|
-
|
1196
|
-
|
1197
|
-
|
1198
|
-
|
1199
|
-
|
1200
|
-
|
1201
|
-
|
1202
|
-
|
1203
|
-
|
1204
|
-
|
1205
|
-
callback_.apply(this, arguments);
|
1206
|
-
};
|
1069
|
+
return { srcStat, destStat };
|
1070
|
+
}
|
1071
|
+
async function checkPaths(src, dest, funcName, opts) {
|
1072
|
+
const { srcStat, destStat } = await getStats(src, dest, opts);
|
1073
|
+
if (destStat) {
|
1074
|
+
if (areIdentical(srcStat, destStat)) {
|
1075
|
+
const srcBaseName = path.basename(src);
|
1076
|
+
const destBaseName = path.basename(dest);
|
1077
|
+
if (funcName === "move" && srcBaseName !== destBaseName && srcBaseName.toLowerCase() === destBaseName.toLowerCase()) {
|
1078
|
+
return { srcStat, destStat, isChangingCase: true };
|
1207
1079
|
}
|
1208
|
-
|
1080
|
+
throw new Error("Source and destination must not be the same.");
|
1209
1081
|
}
|
1210
|
-
if (
|
1211
|
-
|
1212
|
-
|
1213
|
-
|
1214
|
-
|
1215
|
-
var eagCounter = 0;
|
1216
|
-
while (true) {
|
1217
|
-
try {
|
1218
|
-
return fs$readSync.call(fs, fd, buffer, offset, length, position);
|
1219
|
-
} catch (er) {
|
1220
|
-
if (er.code === "EAGAIN" && eagCounter < 10) {
|
1221
|
-
eagCounter++;
|
1222
|
-
continue;
|
1223
|
-
}
|
1224
|
-
throw er;
|
1225
|
-
}
|
1226
|
-
}
|
1227
|
-
};
|
1228
|
-
}(fs.readSync);
|
1229
|
-
function patchLchmod(fs2) {
|
1230
|
-
fs2.lchmod = function(path, mode, callback) {
|
1231
|
-
fs2.open(
|
1232
|
-
path,
|
1233
|
-
constants.O_WRONLY | constants.O_SYMLINK,
|
1234
|
-
mode,
|
1235
|
-
function(err, fd) {
|
1236
|
-
if (err) {
|
1237
|
-
if (callback) callback(err);
|
1238
|
-
return;
|
1239
|
-
}
|
1240
|
-
fs2.fchmod(fd, mode, function(err2) {
|
1241
|
-
fs2.close(fd, function(err22) {
|
1242
|
-
if (callback) callback(err2 || err22);
|
1243
|
-
});
|
1244
|
-
});
|
1245
|
-
}
|
1246
|
-
);
|
1247
|
-
};
|
1248
|
-
fs2.lchmodSync = function(path, mode) {
|
1249
|
-
var fd = fs2.openSync(path, constants.O_WRONLY | constants.O_SYMLINK, mode);
|
1250
|
-
var threw = true;
|
1251
|
-
var ret;
|
1252
|
-
try {
|
1253
|
-
ret = fs2.fchmodSync(fd, mode);
|
1254
|
-
threw = false;
|
1255
|
-
} finally {
|
1256
|
-
if (threw) {
|
1257
|
-
try {
|
1258
|
-
fs2.closeSync(fd);
|
1259
|
-
} catch (er) {
|
1260
|
-
}
|
1261
|
-
} else {
|
1262
|
-
fs2.closeSync(fd);
|
1263
|
-
}
|
1264
|
-
}
|
1265
|
-
return ret;
|
1266
|
-
};
|
1267
|
-
}
|
1268
|
-
function patchLutimes(fs2) {
|
1269
|
-
if (constants.hasOwnProperty("O_SYMLINK") && fs2.futimes) {
|
1270
|
-
fs2.lutimes = function(path, at, mt, cb) {
|
1271
|
-
fs2.open(path, constants.O_SYMLINK, function(er, fd) {
|
1272
|
-
if (er) {
|
1273
|
-
if (cb) cb(er);
|
1274
|
-
return;
|
1275
|
-
}
|
1276
|
-
fs2.futimes(fd, at, mt, function(er2) {
|
1277
|
-
fs2.close(fd, function(er22) {
|
1278
|
-
if (cb) cb(er2 || er22);
|
1279
|
-
});
|
1280
|
-
});
|
1281
|
-
});
|
1282
|
-
};
|
1283
|
-
fs2.lutimesSync = function(path, at, mt) {
|
1284
|
-
var fd = fs2.openSync(path, constants.O_SYMLINK);
|
1285
|
-
var ret;
|
1286
|
-
var threw = true;
|
1287
|
-
try {
|
1288
|
-
ret = fs2.futimesSync(fd, at, mt);
|
1289
|
-
threw = false;
|
1290
|
-
} finally {
|
1291
|
-
if (threw) {
|
1292
|
-
try {
|
1293
|
-
fs2.closeSync(fd);
|
1294
|
-
} catch (er) {
|
1295
|
-
}
|
1296
|
-
} else {
|
1297
|
-
fs2.closeSync(fd);
|
1298
|
-
}
|
1299
|
-
}
|
1300
|
-
return ret;
|
1301
|
-
};
|
1302
|
-
} else if (fs2.futimes) {
|
1303
|
-
fs2.lutimes = function(_a, _b, _c, cb) {
|
1304
|
-
if (cb) process.nextTick(cb);
|
1305
|
-
};
|
1306
|
-
fs2.lutimesSync = function() {
|
1307
|
-
};
|
1082
|
+
if (srcStat.isDirectory() && !destStat.isDirectory()) {
|
1083
|
+
throw new Error(`Cannot overwrite non-directory '${dest}' with directory '${src}'.`);
|
1084
|
+
}
|
1085
|
+
if (!srcStat.isDirectory() && destStat.isDirectory()) {
|
1086
|
+
throw new Error(`Cannot overwrite directory '${dest}' with non-directory '${src}'.`);
|
1308
1087
|
}
|
1309
1088
|
}
|
1310
|
-
|
1311
|
-
|
1312
|
-
return function(target, mode, cb) {
|
1313
|
-
return orig.call(fs, target, mode, function(er) {
|
1314
|
-
if (chownErOk(er)) er = null;
|
1315
|
-
if (cb) cb.apply(this, arguments);
|
1316
|
-
});
|
1317
|
-
};
|
1089
|
+
if (srcStat.isDirectory() && isSrcSubdir(src, dest)) {
|
1090
|
+
throw new Error(errMsg(src, dest, funcName));
|
1318
1091
|
}
|
1319
|
-
|
1320
|
-
|
1321
|
-
|
1322
|
-
|
1323
|
-
|
1324
|
-
|
1325
|
-
|
1092
|
+
return { srcStat, destStat };
|
1093
|
+
}
|
1094
|
+
function checkPathsSync(src, dest, funcName, opts) {
|
1095
|
+
const { srcStat, destStat } = getStatsSync(src, dest, opts);
|
1096
|
+
if (destStat) {
|
1097
|
+
if (areIdentical(srcStat, destStat)) {
|
1098
|
+
const srcBaseName = path.basename(src);
|
1099
|
+
const destBaseName = path.basename(dest);
|
1100
|
+
if (funcName === "move" && srcBaseName !== destBaseName && srcBaseName.toLowerCase() === destBaseName.toLowerCase()) {
|
1101
|
+
return { srcStat, destStat, isChangingCase: true };
|
1326
1102
|
}
|
1327
|
-
|
1103
|
+
throw new Error("Source and destination must not be the same.");
|
1104
|
+
}
|
1105
|
+
if (srcStat.isDirectory() && !destStat.isDirectory()) {
|
1106
|
+
throw new Error(`Cannot overwrite non-directory '${dest}' with directory '${src}'.`);
|
1107
|
+
}
|
1108
|
+
if (!srcStat.isDirectory() && destStat.isDirectory()) {
|
1109
|
+
throw new Error(`Cannot overwrite directory '${dest}' with non-directory '${src}'.`);
|
1110
|
+
}
|
1328
1111
|
}
|
1329
|
-
|
1330
|
-
|
1331
|
-
return function(target, uid, gid, cb) {
|
1332
|
-
return orig.call(fs, target, uid, gid, function(er) {
|
1333
|
-
if (chownErOk(er)) er = null;
|
1334
|
-
if (cb) cb.apply(this, arguments);
|
1335
|
-
});
|
1336
|
-
};
|
1112
|
+
if (srcStat.isDirectory() && isSrcSubdir(src, dest)) {
|
1113
|
+
throw new Error(errMsg(src, dest, funcName));
|
1337
1114
|
}
|
1338
|
-
|
1339
|
-
|
1340
|
-
|
1341
|
-
|
1342
|
-
|
1343
|
-
|
1344
|
-
|
1345
|
-
|
1346
|
-
};
|
1115
|
+
return { srcStat, destStat };
|
1116
|
+
}
|
1117
|
+
async function checkParentPaths(src, srcStat, dest, funcName) {
|
1118
|
+
const srcParent = path.resolve(path.dirname(src));
|
1119
|
+
const destParent = path.resolve(path.dirname(dest));
|
1120
|
+
if (destParent === srcParent || destParent === path.parse(destParent).root) return;
|
1121
|
+
let destStat;
|
1122
|
+
try {
|
1123
|
+
destStat = await fs.stat(destParent, { bigint: true });
|
1124
|
+
} catch (err) {
|
1125
|
+
if (err.code === "ENOENT") return;
|
1126
|
+
throw err;
|
1347
1127
|
}
|
1348
|
-
|
1349
|
-
|
1350
|
-
return function(target, options, cb) {
|
1351
|
-
if (typeof options === "function") {
|
1352
|
-
cb = options;
|
1353
|
-
options = null;
|
1354
|
-
}
|
1355
|
-
function callback(er, stats) {
|
1356
|
-
if (stats) {
|
1357
|
-
if (stats.uid < 0) stats.uid += 4294967296;
|
1358
|
-
if (stats.gid < 0) stats.gid += 4294967296;
|
1359
|
-
}
|
1360
|
-
if (cb) cb.apply(this, arguments);
|
1361
|
-
}
|
1362
|
-
return options ? orig.call(fs, target, options, callback) : orig.call(fs, target, callback);
|
1363
|
-
};
|
1128
|
+
if (areIdentical(srcStat, destStat)) {
|
1129
|
+
throw new Error(errMsg(src, dest, funcName));
|
1364
1130
|
}
|
1365
|
-
|
1366
|
-
|
1367
|
-
|
1368
|
-
|
1369
|
-
|
1370
|
-
|
1371
|
-
|
1372
|
-
|
1373
|
-
|
1374
|
-
|
1131
|
+
return checkParentPaths(src, srcStat, destParent, funcName);
|
1132
|
+
}
|
1133
|
+
function checkParentPathsSync(src, srcStat, dest, funcName) {
|
1134
|
+
const srcParent = path.resolve(path.dirname(src));
|
1135
|
+
const destParent = path.resolve(path.dirname(dest));
|
1136
|
+
if (destParent === srcParent || destParent === path.parse(destParent).root) return;
|
1137
|
+
let destStat;
|
1138
|
+
try {
|
1139
|
+
destStat = fs.statSync(destParent, { bigint: true });
|
1140
|
+
} catch (err) {
|
1141
|
+
if (err.code === "ENOENT") return;
|
1142
|
+
throw err;
|
1375
1143
|
}
|
1376
|
-
|
1377
|
-
|
1378
|
-
return true;
|
1379
|
-
if (er.code === "ENOSYS")
|
1380
|
-
return true;
|
1381
|
-
var nonroot = !process.getuid || process.getuid() !== 0;
|
1382
|
-
if (nonroot) {
|
1383
|
-
if (er.code === "EINVAL" || er.code === "EPERM")
|
1384
|
-
return true;
|
1385
|
-
}
|
1386
|
-
return false;
|
1144
|
+
if (areIdentical(srcStat, destStat)) {
|
1145
|
+
throw new Error(errMsg(src, dest, funcName));
|
1387
1146
|
}
|
1147
|
+
return checkParentPathsSync(src, srcStat, destParent, funcName);
|
1148
|
+
}
|
1149
|
+
function areIdentical(srcStat, destStat) {
|
1150
|
+
return destStat.ino && destStat.dev && destStat.ino === srcStat.ino && destStat.dev === srcStat.dev;
|
1151
|
+
}
|
1152
|
+
function isSrcSubdir(src, dest) {
|
1153
|
+
const srcArr = path.resolve(src).split(path.sep).filter((i) => i);
|
1154
|
+
const destArr = path.resolve(dest).split(path.sep).filter((i) => i);
|
1155
|
+
return srcArr.every((cur, i) => destArr[i] === cur);
|
1156
|
+
}
|
1157
|
+
function errMsg(src, dest, funcName) {
|
1158
|
+
return `Cannot ${funcName} '${src}' to a subdirectory of itself, '${dest}'.`;
|
1388
1159
|
}
|
1160
|
+
module2.exports = {
|
1161
|
+
// checkPaths
|
1162
|
+
checkPaths: u(checkPaths),
|
1163
|
+
checkPathsSync,
|
1164
|
+
// checkParent
|
1165
|
+
checkParentPaths: u(checkParentPaths),
|
1166
|
+
checkParentPathsSync,
|
1167
|
+
// Misc
|
1168
|
+
isSrcSubdir,
|
1169
|
+
areIdentical
|
1170
|
+
};
|
1389
1171
|
}
|
1390
1172
|
});
|
1391
|
-
var
|
1392
|
-
"../../node_modules/.pnpm/
|
1173
|
+
var require_copy = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
1174
|
+
"../../node_modules/.pnpm/fs-extra@11.3.0/node_modules/fs-extra/lib/copy/copy.js"(exports, module2) {
|
1393
1175
|
"use strict";
|
1394
|
-
var
|
1395
|
-
|
1396
|
-
|
1397
|
-
|
1398
|
-
|
1399
|
-
|
1400
|
-
|
1401
|
-
|
1402
|
-
|
1403
|
-
Stream.call(this);
|
1404
|
-
var self = this;
|
1405
|
-
this.path = path;
|
1406
|
-
this.fd = null;
|
1407
|
-
this.readable = true;
|
1408
|
-
this.paused = false;
|
1409
|
-
this.flags = "r";
|
1410
|
-
this.mode = 438;
|
1411
|
-
this.bufferSize = 64 * 1024;
|
1412
|
-
options = options || {};
|
1413
|
-
var keys = Object.keys(options);
|
1414
|
-
for (var index = 0, length = keys.length; index < length; index++) {
|
1415
|
-
var key = keys[index];
|
1416
|
-
this[key] = options[key];
|
1417
|
-
}
|
1418
|
-
if (this.encoding) this.setEncoding(this.encoding);
|
1419
|
-
if (this.start !== void 0) {
|
1420
|
-
if ("number" !== typeof this.start) {
|
1421
|
-
throw TypeError("start must be a Number");
|
1422
|
-
}
|
1423
|
-
if (this.end === void 0) {
|
1424
|
-
this.end = Infinity;
|
1425
|
-
} else if ("number" !== typeof this.end) {
|
1426
|
-
throw TypeError("end must be a Number");
|
1427
|
-
}
|
1428
|
-
if (this.start > this.end) {
|
1429
|
-
throw new Error("start must be <= end");
|
1430
|
-
}
|
1431
|
-
this.pos = this.start;
|
1432
|
-
}
|
1433
|
-
if (this.fd !== null) {
|
1434
|
-
process.nextTick(function() {
|
1435
|
-
self._read();
|
1436
|
-
});
|
1437
|
-
return;
|
1438
|
-
}
|
1439
|
-
fs.open(this.path, this.flags, this.mode, function(err, fd) {
|
1440
|
-
if (err) {
|
1441
|
-
self.emit("error", err);
|
1442
|
-
self.readable = false;
|
1443
|
-
return;
|
1444
|
-
}
|
1445
|
-
self.fd = fd;
|
1446
|
-
self.emit("open", fd);
|
1447
|
-
self._read();
|
1448
|
-
});
|
1176
|
+
var fs = require_fs();
|
1177
|
+
var path = (0, import_chunk_WWAWV7DQ.__require)("path");
|
1178
|
+
var { mkdirs } = require_mkdirs();
|
1179
|
+
var { pathExists } = require_path_exists();
|
1180
|
+
var { utimesMillis } = require_utimes();
|
1181
|
+
var stat = require_stat();
|
1182
|
+
async function copy(src, dest, opts = {}) {
|
1183
|
+
if (typeof opts === "function") {
|
1184
|
+
opts = { filter: opts };
|
1449
1185
|
}
|
1450
|
-
|
1451
|
-
|
1452
|
-
|
1453
|
-
|
1454
|
-
|
1455
|
-
|
1456
|
-
|
1457
|
-
|
1458
|
-
|
1459
|
-
|
1460
|
-
|
1461
|
-
|
1462
|
-
|
1463
|
-
|
1464
|
-
|
1465
|
-
|
1466
|
-
|
1467
|
-
|
1468
|
-
|
1469
|
-
|
1470
|
-
|
1471
|
-
|
1472
|
-
|
1473
|
-
|
1474
|
-
|
1475
|
-
|
1476
|
-
|
1477
|
-
|
1478
|
-
|
1479
|
-
|
1480
|
-
|
1186
|
+
opts.clobber = "clobber" in opts ? !!opts.clobber : true;
|
1187
|
+
opts.overwrite = "overwrite" in opts ? !!opts.overwrite : opts.clobber;
|
1188
|
+
if (opts.preserveTimestamps && process.arch === "ia32") {
|
1189
|
+
process.emitWarning(
|
1190
|
+
"Using the preserveTimestamps option in 32-bit node is not recommended;\n\n see https://github.com/jprichardson/node-fs-extra/issues/269",
|
1191
|
+
"Warning",
|
1192
|
+
"fs-extra-WARN0001"
|
1193
|
+
);
|
1194
|
+
}
|
1195
|
+
const { srcStat, destStat } = await stat.checkPaths(src, dest, "copy", opts);
|
1196
|
+
await stat.checkParentPaths(src, srcStat, dest, "copy");
|
1197
|
+
const include = await runFilter(src, dest, opts);
|
1198
|
+
if (!include) return;
|
1199
|
+
const destParent = path.dirname(dest);
|
1200
|
+
const dirExists = await pathExists(destParent);
|
1201
|
+
if (!dirExists) {
|
1202
|
+
await mkdirs(destParent);
|
1203
|
+
}
|
1204
|
+
await getStatsAndPerformCopy(destStat, src, dest, opts);
|
1205
|
+
}
|
1206
|
+
async function runFilter(src, dest, opts) {
|
1207
|
+
if (!opts.filter) return true;
|
1208
|
+
return opts.filter(src, dest);
|
1209
|
+
}
|
1210
|
+
async function getStatsAndPerformCopy(destStat, src, dest, opts) {
|
1211
|
+
const statFn = opts.dereference ? fs.stat : fs.lstat;
|
1212
|
+
const srcStat = await statFn(src);
|
1213
|
+
if (srcStat.isDirectory()) return onDir(srcStat, destStat, src, dest, opts);
|
1214
|
+
if (srcStat.isFile() || srcStat.isCharacterDevice() || srcStat.isBlockDevice()) return onFile(srcStat, destStat, src, dest, opts);
|
1215
|
+
if (srcStat.isSymbolicLink()) return onLink(destStat, src, dest, opts);
|
1216
|
+
if (srcStat.isSocket()) throw new Error(`Cannot copy a socket file: ${src}`);
|
1217
|
+
if (srcStat.isFIFO()) throw new Error(`Cannot copy a FIFO pipe: ${src}`);
|
1218
|
+
throw new Error(`Unknown file: ${src}`);
|
1219
|
+
}
|
1220
|
+
async function onFile(srcStat, destStat, src, dest, opts) {
|
1221
|
+
if (!destStat) return copyFile(srcStat, src, dest, opts);
|
1222
|
+
if (opts.overwrite) {
|
1223
|
+
await fs.unlink(dest);
|
1224
|
+
return copyFile(srcStat, src, dest, opts);
|
1225
|
+
}
|
1226
|
+
if (opts.errorOnExist) {
|
1227
|
+
throw new Error(`'${dest}' already exists`);
|
1228
|
+
}
|
1229
|
+
}
|
1230
|
+
async function copyFile(srcStat, src, dest, opts) {
|
1231
|
+
await fs.copyFile(src, dest);
|
1232
|
+
if (opts.preserveTimestamps) {
|
1233
|
+
if (fileIsNotWritable(srcStat.mode)) {
|
1234
|
+
await makeFileWritable(dest, srcStat.mode);
|
1481
1235
|
}
|
1236
|
+
const updatedSrcStat = await fs.stat(src);
|
1237
|
+
await utimesMillis(dest, updatedSrcStat.atime, updatedSrcStat.mtime);
|
1238
|
+
}
|
1239
|
+
return fs.chmod(dest, srcStat.mode);
|
1240
|
+
}
|
1241
|
+
function fileIsNotWritable(srcMode) {
|
1242
|
+
return (srcMode & 128) === 0;
|
1243
|
+
}
|
1244
|
+
function makeFileWritable(dest, srcMode) {
|
1245
|
+
return fs.chmod(dest, srcMode | 128);
|
1246
|
+
}
|
1247
|
+
async function onDir(srcStat, destStat, src, dest, opts) {
|
1248
|
+
if (!destStat) {
|
1249
|
+
await fs.mkdir(dest);
|
1250
|
+
}
|
1251
|
+
const promises = [];
|
1252
|
+
for await (const item of await fs.opendir(src)) {
|
1253
|
+
const srcItem = path.join(src, item.name);
|
1254
|
+
const destItem = path.join(dest, item.name);
|
1255
|
+
promises.push(
|
1256
|
+
runFilter(srcItem, destItem, opts).then((include) => {
|
1257
|
+
if (include) {
|
1258
|
+
return stat.checkPaths(srcItem, destItem, "copy", opts).then(({ destStat: destStat2 }) => {
|
1259
|
+
return getStatsAndPerformCopy(destStat2, srcItem, destItem, opts);
|
1260
|
+
});
|
1261
|
+
}
|
1262
|
+
})
|
1263
|
+
);
|
1264
|
+
}
|
1265
|
+
await Promise.all(promises);
|
1266
|
+
if (!destStat) {
|
1267
|
+
await fs.chmod(dest, srcStat.mode);
|
1268
|
+
}
|
1269
|
+
}
|
1270
|
+
async function onLink(destStat, src, dest, opts) {
|
1271
|
+
let resolvedSrc = await fs.readlink(src);
|
1272
|
+
if (opts.dereference) {
|
1273
|
+
resolvedSrc = path.resolve(process.cwd(), resolvedSrc);
|
1274
|
+
}
|
1275
|
+
if (!destStat) {
|
1276
|
+
return fs.symlink(resolvedSrc, dest);
|
1277
|
+
}
|
1278
|
+
let resolvedDest = null;
|
1279
|
+
try {
|
1280
|
+
resolvedDest = await fs.readlink(dest);
|
1281
|
+
} catch (e) {
|
1282
|
+
if (e.code === "EINVAL" || e.code === "UNKNOWN") return fs.symlink(resolvedSrc, dest);
|
1283
|
+
throw e;
|
1284
|
+
}
|
1285
|
+
if (opts.dereference) {
|
1286
|
+
resolvedDest = path.resolve(process.cwd(), resolvedDest);
|
1287
|
+
}
|
1288
|
+
if (stat.isSrcSubdir(resolvedSrc, resolvedDest)) {
|
1289
|
+
throw new Error(`Cannot copy '${resolvedSrc}' to a subdirectory of itself, '${resolvedDest}'.`);
|
1482
1290
|
}
|
1291
|
+
if (stat.isSrcSubdir(resolvedDest, resolvedSrc)) {
|
1292
|
+
throw new Error(`Cannot overwrite '${resolvedDest}' with '${resolvedSrc}'.`);
|
1293
|
+
}
|
1294
|
+
await fs.unlink(dest);
|
1295
|
+
return fs.symlink(resolvedSrc, dest);
|
1483
1296
|
}
|
1297
|
+
module2.exports = copy;
|
1484
1298
|
}
|
1485
1299
|
});
|
1486
|
-
var
|
1487
|
-
"../../node_modules/.pnpm/
|
1300
|
+
var require_copy_sync = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
1301
|
+
"../../node_modules/.pnpm/fs-extra@11.3.0/node_modules/fs-extra/lib/copy/copy-sync.js"(exports, module2) {
|
1488
1302
|
"use strict";
|
1489
|
-
|
1490
|
-
var
|
1491
|
-
|
1492
|
-
|
1493
|
-
|
1494
|
-
|
1495
|
-
|
1496
|
-
|
1497
|
-
|
1498
|
-
|
1499
|
-
|
1500
|
-
|
1501
|
-
|
1502
|
-
|
1503
|
-
|
1303
|
+
var fs = require_graceful_fs();
|
1304
|
+
var path = (0, import_chunk_WWAWV7DQ.__require)("path");
|
1305
|
+
var mkdirsSync = require_mkdirs().mkdirsSync;
|
1306
|
+
var utimesMillisSync = require_utimes().utimesMillisSync;
|
1307
|
+
var stat = require_stat();
|
1308
|
+
function copySync(src, dest, opts) {
|
1309
|
+
if (typeof opts === "function") {
|
1310
|
+
opts = { filter: opts };
|
1311
|
+
}
|
1312
|
+
opts = opts || {};
|
1313
|
+
opts.clobber = "clobber" in opts ? !!opts.clobber : true;
|
1314
|
+
opts.overwrite = "overwrite" in opts ? !!opts.overwrite : opts.clobber;
|
1315
|
+
if (opts.preserveTimestamps && process.arch === "ia32") {
|
1316
|
+
process.emitWarning(
|
1317
|
+
"Using the preserveTimestamps option in 32-bit node is not recommended;\n\n see https://github.com/jprichardson/node-fs-extra/issues/269",
|
1318
|
+
"Warning",
|
1319
|
+
"fs-extra-WARN0002"
|
1320
|
+
);
|
1321
|
+
}
|
1322
|
+
const { srcStat, destStat } = stat.checkPathsSync(src, dest, "copy", opts);
|
1323
|
+
stat.checkParentPathsSync(src, srcStat, dest, "copy");
|
1324
|
+
if (opts.filter && !opts.filter(src, dest)) return;
|
1325
|
+
const destParent = path.dirname(dest);
|
1326
|
+
if (!fs.existsSync(destParent)) mkdirsSync(destParent);
|
1327
|
+
return getStats(destStat, src, dest, opts);
|
1504
1328
|
}
|
1505
|
-
|
1506
|
-
|
1507
|
-
|
1508
|
-
|
1509
|
-
|
1510
|
-
|
1511
|
-
|
1512
|
-
|
1513
|
-
|
1514
|
-
var util = (0, import_chunk_WWAWV7DQ.__require)("util");
|
1515
|
-
var gracefulQueue;
|
1516
|
-
var previousSymbol;
|
1517
|
-
if (typeof Symbol === "function" && typeof Symbol.for === "function") {
|
1518
|
-
gracefulQueue = Symbol.for("graceful-fs.queue");
|
1519
|
-
previousSymbol = Symbol.for("graceful-fs.previous");
|
1520
|
-
} else {
|
1521
|
-
gracefulQueue = "___graceful-fs.queue";
|
1522
|
-
previousSymbol = "___graceful-fs.previous";
|
1329
|
+
function getStats(destStat, src, dest, opts) {
|
1330
|
+
const statSync = opts.dereference ? fs.statSync : fs.lstatSync;
|
1331
|
+
const srcStat = statSync(src);
|
1332
|
+
if (srcStat.isDirectory()) return onDir(srcStat, destStat, src, dest, opts);
|
1333
|
+
else if (srcStat.isFile() || srcStat.isCharacterDevice() || srcStat.isBlockDevice()) return onFile(srcStat, destStat, src, dest, opts);
|
1334
|
+
else if (srcStat.isSymbolicLink()) return onLink(destStat, src, dest, opts);
|
1335
|
+
else if (srcStat.isSocket()) throw new Error(`Cannot copy a socket file: ${src}`);
|
1336
|
+
else if (srcStat.isFIFO()) throw new Error(`Cannot copy a FIFO pipe: ${src}`);
|
1337
|
+
throw new Error(`Unknown file: ${src}`);
|
1523
1338
|
}
|
1524
|
-
function
|
1339
|
+
function onFile(srcStat, destStat, src, dest, opts) {
|
1340
|
+
if (!destStat) return copyFile(srcStat, src, dest, opts);
|
1341
|
+
return mayCopyFile(srcStat, src, dest, opts);
|
1525
1342
|
}
|
1526
|
-
function
|
1527
|
-
|
1528
|
-
|
1529
|
-
|
1343
|
+
function mayCopyFile(srcStat, src, dest, opts) {
|
1344
|
+
if (opts.overwrite) {
|
1345
|
+
fs.unlinkSync(dest);
|
1346
|
+
return copyFile(srcStat, src, dest, opts);
|
1347
|
+
} else if (opts.errorOnExist) {
|
1348
|
+
throw new Error(`'${dest}' already exists`);
|
1349
|
+
}
|
1350
|
+
}
|
1351
|
+
function copyFile(srcStat, src, dest, opts) {
|
1352
|
+
fs.copyFileSync(src, dest);
|
1353
|
+
if (opts.preserveTimestamps) handleTimestamps(srcStat.mode, src, dest);
|
1354
|
+
return setDestMode(dest, srcStat.mode);
|
1355
|
+
}
|
1356
|
+
function handleTimestamps(srcMode, src, dest) {
|
1357
|
+
if (fileIsNotWritable(srcMode)) makeFileWritable(dest, srcMode);
|
1358
|
+
return setDestTimestamps(src, dest);
|
1359
|
+
}
|
1360
|
+
function fileIsNotWritable(srcMode) {
|
1361
|
+
return (srcMode & 128) === 0;
|
1362
|
+
}
|
1363
|
+
function makeFileWritable(dest, srcMode) {
|
1364
|
+
return setDestMode(dest, srcMode | 128);
|
1365
|
+
}
|
1366
|
+
function setDestMode(dest, srcMode) {
|
1367
|
+
return fs.chmodSync(dest, srcMode);
|
1368
|
+
}
|
1369
|
+
function setDestTimestamps(src, dest) {
|
1370
|
+
const updatedSrcStat = fs.statSync(src);
|
1371
|
+
return utimesMillisSync(dest, updatedSrcStat.atime, updatedSrcStat.mtime);
|
1372
|
+
}
|
1373
|
+
function onDir(srcStat, destStat, src, dest, opts) {
|
1374
|
+
if (!destStat) return mkDirAndCopy(srcStat.mode, src, dest, opts);
|
1375
|
+
return copyDir(src, dest, opts);
|
1376
|
+
}
|
1377
|
+
function mkDirAndCopy(srcMode, src, dest, opts) {
|
1378
|
+
fs.mkdirSync(dest);
|
1379
|
+
copyDir(src, dest, opts);
|
1380
|
+
return setDestMode(dest, srcMode);
|
1381
|
+
}
|
1382
|
+
function copyDir(src, dest, opts) {
|
1383
|
+
const dir = fs.opendirSync(src);
|
1384
|
+
try {
|
1385
|
+
let dirent;
|
1386
|
+
while ((dirent = dir.readSync()) !== null) {
|
1387
|
+
copyDirItem(dirent.name, src, dest, opts);
|
1530
1388
|
}
|
1531
|
-
}
|
1389
|
+
} finally {
|
1390
|
+
dir.closeSync();
|
1391
|
+
}
|
1532
1392
|
}
|
1533
|
-
|
1534
|
-
|
1535
|
-
|
1536
|
-
|
1537
|
-
|
1538
|
-
|
1539
|
-
|
1540
|
-
|
1541
|
-
|
1542
|
-
|
1543
|
-
|
1544
|
-
|
1545
|
-
|
1546
|
-
|
1547
|
-
|
1548
|
-
|
1549
|
-
|
1550
|
-
|
1551
|
-
|
1552
|
-
|
1553
|
-
|
1393
|
+
function copyDirItem(item, src, dest, opts) {
|
1394
|
+
const srcItem = path.join(src, item);
|
1395
|
+
const destItem = path.join(dest, item);
|
1396
|
+
if (opts.filter && !opts.filter(srcItem, destItem)) return;
|
1397
|
+
const { destStat } = stat.checkPathsSync(srcItem, destItem, "copy", opts);
|
1398
|
+
return getStats(destStat, srcItem, destItem, opts);
|
1399
|
+
}
|
1400
|
+
function onLink(destStat, src, dest, opts) {
|
1401
|
+
let resolvedSrc = fs.readlinkSync(src);
|
1402
|
+
if (opts.dereference) {
|
1403
|
+
resolvedSrc = path.resolve(process.cwd(), resolvedSrc);
|
1404
|
+
}
|
1405
|
+
if (!destStat) {
|
1406
|
+
return fs.symlinkSync(resolvedSrc, dest);
|
1407
|
+
} else {
|
1408
|
+
let resolvedDest;
|
1409
|
+
try {
|
1410
|
+
resolvedDest = fs.readlinkSync(dest);
|
1411
|
+
} catch (err) {
|
1412
|
+
if (err.code === "EINVAL" || err.code === "UNKNOWN") return fs.symlinkSync(resolvedSrc, dest);
|
1413
|
+
throw err;
|
1554
1414
|
}
|
1555
|
-
|
1556
|
-
|
1557
|
-
});
|
1558
|
-
return close;
|
1559
|
-
}(fs.close);
|
1560
|
-
fs.closeSync = function(fs$closeSync) {
|
1561
|
-
function closeSync(fd) {
|
1562
|
-
fs$closeSync.apply(fs, arguments);
|
1563
|
-
resetQueue();
|
1415
|
+
if (opts.dereference) {
|
1416
|
+
resolvedDest = path.resolve(process.cwd(), resolvedDest);
|
1564
1417
|
}
|
1565
|
-
|
1566
|
-
|
1567
|
-
}
|
1568
|
-
|
1569
|
-
|
1570
|
-
|
1571
|
-
|
1572
|
-
debug(fs[gracefulQueue]);
|
1573
|
-
(0, import_chunk_WWAWV7DQ.__require)("assert").equal(fs[gracefulQueue].length, 0);
|
1574
|
-
});
|
1418
|
+
if (stat.isSrcSubdir(resolvedSrc, resolvedDest)) {
|
1419
|
+
throw new Error(`Cannot copy '${resolvedSrc}' to a subdirectory of itself, '${resolvedDest}'.`);
|
1420
|
+
}
|
1421
|
+
if (stat.isSrcSubdir(resolvedDest, resolvedSrc)) {
|
1422
|
+
throw new Error(`Cannot overwrite '${resolvedDest}' with '${resolvedSrc}'.`);
|
1423
|
+
}
|
1424
|
+
return copyLink(resolvedSrc, dest);
|
1575
1425
|
}
|
1576
1426
|
}
|
1577
|
-
|
1578
|
-
|
1579
|
-
|
1427
|
+
function copyLink(resolvedSrc, dest) {
|
1428
|
+
fs.unlinkSync(dest);
|
1429
|
+
return fs.symlinkSync(resolvedSrc, dest);
|
1580
1430
|
}
|
1581
|
-
module2.exports =
|
1582
|
-
|
1583
|
-
|
1584
|
-
|
1431
|
+
module2.exports = copySync;
|
1432
|
+
}
|
1433
|
+
});
|
1434
|
+
var require_copy2 = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
1435
|
+
"../../node_modules/.pnpm/fs-extra@11.3.0/node_modules/fs-extra/lib/copy/index.js"(exports, module2) {
|
1436
|
+
"use strict";
|
1437
|
+
var u = require_universalify().fromPromise;
|
1438
|
+
module2.exports = {
|
1439
|
+
copy: u(require_copy()),
|
1440
|
+
copySync: require_copy_sync()
|
1441
|
+
};
|
1442
|
+
}
|
1443
|
+
});
|
1444
|
+
var require_remove = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
1445
|
+
"../../node_modules/.pnpm/fs-extra@11.3.0/node_modules/fs-extra/lib/remove/index.js"(exports, module2) {
|
1446
|
+
"use strict";
|
1447
|
+
var fs = require_graceful_fs();
|
1448
|
+
var u = require_universalify().fromCallback;
|
1449
|
+
function remove(path, callback) {
|
1450
|
+
fs.rm(path, { recursive: true, force: true }, callback);
|
1585
1451
|
}
|
1586
|
-
function
|
1587
|
-
|
1588
|
-
|
1589
|
-
|
1590
|
-
|
1591
|
-
|
1592
|
-
|
1593
|
-
|
1594
|
-
|
1595
|
-
|
1596
|
-
|
1597
|
-
|
1598
|
-
|
1599
|
-
|
1600
|
-
|
1601
|
-
|
1602
|
-
|
1603
|
-
|
1604
|
-
|
1605
|
-
|
1606
|
-
|
1452
|
+
function removeSync(path) {
|
1453
|
+
fs.rmSync(path, { recursive: true, force: true });
|
1454
|
+
}
|
1455
|
+
module2.exports = {
|
1456
|
+
remove: u(remove),
|
1457
|
+
removeSync
|
1458
|
+
};
|
1459
|
+
}
|
1460
|
+
});
|
1461
|
+
var require_empty = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
1462
|
+
"../../node_modules/.pnpm/fs-extra@11.3.0/node_modules/fs-extra/lib/empty/index.js"(exports, module2) {
|
1463
|
+
"use strict";
|
1464
|
+
var u = require_universalify().fromPromise;
|
1465
|
+
var fs = require_fs();
|
1466
|
+
var path = (0, import_chunk_WWAWV7DQ.__require)("path");
|
1467
|
+
var mkdir = require_mkdirs();
|
1468
|
+
var remove = require_remove();
|
1469
|
+
var emptyDir = u(async function emptyDir2(dir) {
|
1470
|
+
let items;
|
1471
|
+
try {
|
1472
|
+
items = await fs.readdir(dir);
|
1473
|
+
} catch {
|
1474
|
+
return mkdir.mkdirs(dir);
|
1607
1475
|
}
|
1608
|
-
|
1609
|
-
|
1610
|
-
|
1611
|
-
|
1612
|
-
|
1613
|
-
|
1614
|
-
|
1615
|
-
|
1616
|
-
if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
|
1617
|
-
enqueue([go$writeFile, [path2, data2, options2, cb2], err, startTime || Date.now(), Date.now()]);
|
1618
|
-
else {
|
1619
|
-
if (typeof cb2 === "function")
|
1620
|
-
cb2.apply(this, arguments);
|
1621
|
-
}
|
1622
|
-
});
|
1623
|
-
}
|
1476
|
+
return Promise.all(items.map((item) => remove.remove(path.join(dir, item))));
|
1477
|
+
});
|
1478
|
+
function emptyDirSync(dir) {
|
1479
|
+
let items;
|
1480
|
+
try {
|
1481
|
+
items = fs.readdirSync(dir);
|
1482
|
+
} catch {
|
1483
|
+
return mkdir.mkdirsSync(dir);
|
1624
1484
|
}
|
1625
|
-
|
1626
|
-
|
1627
|
-
|
1628
|
-
|
1629
|
-
|
1630
|
-
|
1631
|
-
|
1632
|
-
|
1633
|
-
|
1634
|
-
|
1635
|
-
|
1636
|
-
|
1637
|
-
|
1638
|
-
|
1639
|
-
|
1640
|
-
|
1641
|
-
|
1485
|
+
items.forEach((item) => {
|
1486
|
+
item = path.join(dir, item);
|
1487
|
+
remove.removeSync(item);
|
1488
|
+
});
|
1489
|
+
}
|
1490
|
+
module2.exports = {
|
1491
|
+
emptyDirSync,
|
1492
|
+
emptydirSync: emptyDirSync,
|
1493
|
+
emptyDir,
|
1494
|
+
emptydir: emptyDir
|
1495
|
+
};
|
1496
|
+
}
|
1497
|
+
});
|
1498
|
+
var require_file = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
1499
|
+
"../../node_modules/.pnpm/fs-extra@11.3.0/node_modules/fs-extra/lib/ensure/file.js"(exports, module2) {
|
1500
|
+
"use strict";
|
1501
|
+
var u = require_universalify().fromPromise;
|
1502
|
+
var path = (0, import_chunk_WWAWV7DQ.__require)("path");
|
1503
|
+
var fs = require_fs();
|
1504
|
+
var mkdir = require_mkdirs();
|
1505
|
+
async function createFile(file) {
|
1506
|
+
let stats;
|
1507
|
+
try {
|
1508
|
+
stats = await fs.stat(file);
|
1509
|
+
} catch {
|
1642
1510
|
}
|
1643
|
-
|
1644
|
-
|
1645
|
-
|
1646
|
-
|
1647
|
-
|
1648
|
-
|
1649
|
-
|
1650
|
-
|
1651
|
-
|
1652
|
-
|
1653
|
-
|
1654
|
-
|
1655
|
-
enqueue([go$copyFile, [src2, dest2, flags2, cb2], err, startTime || Date.now(), Date.now()]);
|
1656
|
-
else {
|
1657
|
-
if (typeof cb2 === "function")
|
1658
|
-
cb2.apply(this, arguments);
|
1659
|
-
}
|
1660
|
-
});
|
1511
|
+
if (stats && stats.isFile()) return;
|
1512
|
+
const dir = path.dirname(file);
|
1513
|
+
let dirStats = null;
|
1514
|
+
try {
|
1515
|
+
dirStats = await fs.stat(dir);
|
1516
|
+
} catch (err) {
|
1517
|
+
if (err.code === "ENOENT") {
|
1518
|
+
await mkdir.mkdirs(dir);
|
1519
|
+
await fs.writeFile(file, "");
|
1520
|
+
return;
|
1521
|
+
} else {
|
1522
|
+
throw err;
|
1661
1523
|
}
|
1662
1524
|
}
|
1663
|
-
|
1664
|
-
|
1665
|
-
|
1666
|
-
|
1667
|
-
|
1668
|
-
|
1669
|
-
|
1670
|
-
|
1671
|
-
|
1672
|
-
|
1673
|
-
|
1674
|
-
|
1675
|
-
|
1676
|
-
|
1677
|
-
|
1678
|
-
|
1679
|
-
|
1680
|
-
cb2,
|
1681
|
-
startTime
|
1682
|
-
));
|
1683
|
-
};
|
1684
|
-
return go$readdir(path, options, cb);
|
1685
|
-
function fs$readdirCallback(path2, options2, cb2, startTime) {
|
1686
|
-
return function(err, files) {
|
1687
|
-
if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
|
1688
|
-
enqueue([
|
1689
|
-
go$readdir,
|
1690
|
-
[path2, options2, cb2],
|
1691
|
-
err,
|
1692
|
-
startTime || Date.now(),
|
1693
|
-
Date.now()
|
1694
|
-
]);
|
1695
|
-
else {
|
1696
|
-
if (files && files.sort)
|
1697
|
-
files.sort();
|
1698
|
-
if (typeof cb2 === "function")
|
1699
|
-
cb2.call(this, err, files);
|
1700
|
-
}
|
1701
|
-
};
|
1525
|
+
if (dirStats.isDirectory()) {
|
1526
|
+
await fs.writeFile(file, "");
|
1527
|
+
} else {
|
1528
|
+
await fs.readdir(dir);
|
1529
|
+
}
|
1530
|
+
}
|
1531
|
+
function createFileSync(file) {
|
1532
|
+
let stats;
|
1533
|
+
try {
|
1534
|
+
stats = fs.statSync(file);
|
1535
|
+
} catch {
|
1536
|
+
}
|
1537
|
+
if (stats && stats.isFile()) return;
|
1538
|
+
const dir = path.dirname(file);
|
1539
|
+
try {
|
1540
|
+
if (!fs.statSync(dir).isDirectory()) {
|
1541
|
+
fs.readdirSync(dir);
|
1702
1542
|
}
|
1543
|
+
} catch (err) {
|
1544
|
+
if (err && err.code === "ENOENT") mkdir.mkdirsSync(dir);
|
1545
|
+
else throw err;
|
1703
1546
|
}
|
1704
|
-
|
1705
|
-
|
1706
|
-
|
1707
|
-
|
1547
|
+
fs.writeFileSync(file, "");
|
1548
|
+
}
|
1549
|
+
module2.exports = {
|
1550
|
+
createFile: u(createFile),
|
1551
|
+
createFileSync
|
1552
|
+
};
|
1553
|
+
}
|
1554
|
+
});
|
1555
|
+
var require_link = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
1556
|
+
"../../node_modules/.pnpm/fs-extra@11.3.0/node_modules/fs-extra/lib/ensure/link.js"(exports, module2) {
|
1557
|
+
"use strict";
|
1558
|
+
var u = require_universalify().fromPromise;
|
1559
|
+
var path = (0, import_chunk_WWAWV7DQ.__require)("path");
|
1560
|
+
var fs = require_fs();
|
1561
|
+
var mkdir = require_mkdirs();
|
1562
|
+
var { pathExists } = require_path_exists();
|
1563
|
+
var { areIdentical } = require_stat();
|
1564
|
+
async function createLink(srcpath, dstpath) {
|
1565
|
+
let dstStat;
|
1566
|
+
try {
|
1567
|
+
dstStat = await fs.lstat(dstpath);
|
1568
|
+
} catch {
|
1708
1569
|
}
|
1709
|
-
|
1710
|
-
|
1711
|
-
|
1712
|
-
|
1570
|
+
let srcStat;
|
1571
|
+
try {
|
1572
|
+
srcStat = await fs.lstat(srcpath);
|
1573
|
+
} catch (err) {
|
1574
|
+
err.message = err.message.replace("lstat", "ensureLink");
|
1575
|
+
throw err;
|
1713
1576
|
}
|
1714
|
-
|
1715
|
-
|
1716
|
-
|
1717
|
-
|
1577
|
+
if (dstStat && areIdentical(srcStat, dstStat)) return;
|
1578
|
+
const dir = path.dirname(dstpath);
|
1579
|
+
const dirExists = await pathExists(dir);
|
1580
|
+
if (!dirExists) {
|
1581
|
+
await mkdir.mkdirs(dir);
|
1718
1582
|
}
|
1719
|
-
|
1720
|
-
|
1721
|
-
|
1722
|
-
|
1723
|
-
|
1724
|
-
|
1725
|
-
|
1726
|
-
enumerable: true,
|
1727
|
-
configurable: true
|
1728
|
-
});
|
1729
|
-
Object.defineProperty(fs2, "WriteStream", {
|
1730
|
-
get: function() {
|
1731
|
-
return WriteStream;
|
1732
|
-
},
|
1733
|
-
set: function(val) {
|
1734
|
-
WriteStream = val;
|
1735
|
-
},
|
1736
|
-
enumerable: true,
|
1737
|
-
configurable: true
|
1738
|
-
});
|
1739
|
-
var FileReadStream = ReadStream;
|
1740
|
-
Object.defineProperty(fs2, "FileReadStream", {
|
1741
|
-
get: function() {
|
1742
|
-
return FileReadStream;
|
1743
|
-
},
|
1744
|
-
set: function(val) {
|
1745
|
-
FileReadStream = val;
|
1746
|
-
},
|
1747
|
-
enumerable: true,
|
1748
|
-
configurable: true
|
1749
|
-
});
|
1750
|
-
var FileWriteStream = WriteStream;
|
1751
|
-
Object.defineProperty(fs2, "FileWriteStream", {
|
1752
|
-
get: function() {
|
1753
|
-
return FileWriteStream;
|
1754
|
-
},
|
1755
|
-
set: function(val) {
|
1756
|
-
FileWriteStream = val;
|
1757
|
-
},
|
1758
|
-
enumerable: true,
|
1759
|
-
configurable: true
|
1760
|
-
});
|
1761
|
-
function ReadStream(path, options) {
|
1762
|
-
if (this instanceof ReadStream)
|
1763
|
-
return fs$ReadStream.apply(this, arguments), this;
|
1764
|
-
else
|
1765
|
-
return ReadStream.apply(Object.create(ReadStream.prototype), arguments);
|
1583
|
+
await fs.link(srcpath, dstpath);
|
1584
|
+
}
|
1585
|
+
function createLinkSync(srcpath, dstpath) {
|
1586
|
+
let dstStat;
|
1587
|
+
try {
|
1588
|
+
dstStat = fs.lstatSync(dstpath);
|
1589
|
+
} catch {
|
1766
1590
|
}
|
1767
|
-
|
1768
|
-
|
1769
|
-
|
1770
|
-
|
1771
|
-
|
1772
|
-
|
1773
|
-
that.emit("error", err);
|
1774
|
-
} else {
|
1775
|
-
that.fd = fd;
|
1776
|
-
that.emit("open", fd);
|
1777
|
-
that.read();
|
1778
|
-
}
|
1779
|
-
});
|
1591
|
+
try {
|
1592
|
+
const srcStat = fs.lstatSync(srcpath);
|
1593
|
+
if (dstStat && areIdentical(srcStat, dstStat)) return;
|
1594
|
+
} catch (err) {
|
1595
|
+
err.message = err.message.replace("lstat", "ensureLink");
|
1596
|
+
throw err;
|
1780
1597
|
}
|
1781
|
-
|
1782
|
-
|
1783
|
-
|
1784
|
-
|
1785
|
-
|
1598
|
+
const dir = path.dirname(dstpath);
|
1599
|
+
const dirExists = fs.existsSync(dir);
|
1600
|
+
if (dirExists) return fs.linkSync(srcpath, dstpath);
|
1601
|
+
mkdir.mkdirsSync(dir);
|
1602
|
+
return fs.linkSync(srcpath, dstpath);
|
1603
|
+
}
|
1604
|
+
module2.exports = {
|
1605
|
+
createLink: u(createLink),
|
1606
|
+
createLinkSync
|
1607
|
+
};
|
1608
|
+
}
|
1609
|
+
});
|
1610
|
+
var require_symlink_paths = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
1611
|
+
"../../node_modules/.pnpm/fs-extra@11.3.0/node_modules/fs-extra/lib/ensure/symlink-paths.js"(exports, module2) {
|
1612
|
+
"use strict";
|
1613
|
+
var path = (0, import_chunk_WWAWV7DQ.__require)("path");
|
1614
|
+
var fs = require_fs();
|
1615
|
+
var { pathExists } = require_path_exists();
|
1616
|
+
var u = require_universalify().fromPromise;
|
1617
|
+
async function symlinkPaths(srcpath, dstpath) {
|
1618
|
+
if (path.isAbsolute(srcpath)) {
|
1619
|
+
try {
|
1620
|
+
await fs.lstat(srcpath);
|
1621
|
+
} catch (err) {
|
1622
|
+
err.message = err.message.replace("lstat", "ensureSymlink");
|
1623
|
+
throw err;
|
1624
|
+
}
|
1625
|
+
return {
|
1626
|
+
toCwd: srcpath,
|
1627
|
+
toDst: srcpath
|
1628
|
+
};
|
1786
1629
|
}
|
1787
|
-
|
1788
|
-
|
1789
|
-
|
1790
|
-
|
1791
|
-
|
1792
|
-
|
1793
|
-
|
1794
|
-
|
1795
|
-
that.emit("open", fd);
|
1796
|
-
}
|
1797
|
-
});
|
1630
|
+
const dstdir = path.dirname(dstpath);
|
1631
|
+
const relativeToDst = path.join(dstdir, srcpath);
|
1632
|
+
const exists = await pathExists(relativeToDst);
|
1633
|
+
if (exists) {
|
1634
|
+
return {
|
1635
|
+
toCwd: relativeToDst,
|
1636
|
+
toDst: srcpath
|
1637
|
+
};
|
1798
1638
|
}
|
1799
|
-
|
1800
|
-
|
1639
|
+
try {
|
1640
|
+
await fs.lstat(srcpath);
|
1641
|
+
} catch (err) {
|
1642
|
+
err.message = err.message.replace("lstat", "ensureSymlink");
|
1643
|
+
throw err;
|
1801
1644
|
}
|
1802
|
-
|
1803
|
-
|
1645
|
+
return {
|
1646
|
+
toCwd: srcpath,
|
1647
|
+
toDst: path.relative(dstdir, srcpath)
|
1648
|
+
};
|
1649
|
+
}
|
1650
|
+
function symlinkPathsSync(srcpath, dstpath) {
|
1651
|
+
if (path.isAbsolute(srcpath)) {
|
1652
|
+
const exists2 = fs.existsSync(srcpath);
|
1653
|
+
if (!exists2) throw new Error("absolute srcpath does not exist");
|
1654
|
+
return {
|
1655
|
+
toCwd: srcpath,
|
1656
|
+
toDst: srcpath
|
1657
|
+
};
|
1804
1658
|
}
|
1805
|
-
|
1806
|
-
|
1807
|
-
|
1808
|
-
|
1809
|
-
|
1810
|
-
|
1811
|
-
|
1812
|
-
|
1813
|
-
if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
|
1814
|
-
enqueue([go$open, [path2, flags2, mode2, cb2], err, startTime || Date.now(), Date.now()]);
|
1815
|
-
else {
|
1816
|
-
if (typeof cb2 === "function")
|
1817
|
-
cb2.apply(this, arguments);
|
1818
|
-
}
|
1819
|
-
});
|
1820
|
-
}
|
1659
|
+
const dstdir = path.dirname(dstpath);
|
1660
|
+
const relativeToDst = path.join(dstdir, srcpath);
|
1661
|
+
const exists = fs.existsSync(relativeToDst);
|
1662
|
+
if (exists) {
|
1663
|
+
return {
|
1664
|
+
toCwd: relativeToDst,
|
1665
|
+
toDst: srcpath
|
1666
|
+
};
|
1821
1667
|
}
|
1822
|
-
|
1668
|
+
const srcExists = fs.existsSync(srcpath);
|
1669
|
+
if (!srcExists) throw new Error("relative srcpath does not exist");
|
1670
|
+
return {
|
1671
|
+
toCwd: srcpath,
|
1672
|
+
toDst: path.relative(dstdir, srcpath)
|
1673
|
+
};
|
1823
1674
|
}
|
1824
|
-
|
1825
|
-
|
1826
|
-
|
1827
|
-
|
1675
|
+
module2.exports = {
|
1676
|
+
symlinkPaths: u(symlinkPaths),
|
1677
|
+
symlinkPathsSync
|
1678
|
+
};
|
1679
|
+
}
|
1680
|
+
});
|
1681
|
+
var require_symlink_type = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
1682
|
+
"../../node_modules/.pnpm/fs-extra@11.3.0/node_modules/fs-extra/lib/ensure/symlink-type.js"(exports, module2) {
|
1683
|
+
"use strict";
|
1684
|
+
var fs = require_fs();
|
1685
|
+
var u = require_universalify().fromPromise;
|
1686
|
+
async function symlinkType(srcpath, type) {
|
1687
|
+
if (type) return type;
|
1688
|
+
let stats;
|
1689
|
+
try {
|
1690
|
+
stats = await fs.lstat(srcpath);
|
1691
|
+
} catch {
|
1692
|
+
return "file";
|
1693
|
+
}
|
1694
|
+
return stats && stats.isDirectory() ? "dir" : "file";
|
1828
1695
|
}
|
1829
|
-
|
1830
|
-
|
1831
|
-
|
1832
|
-
|
1833
|
-
|
1834
|
-
|
1835
|
-
|
1836
|
-
}
|
1696
|
+
function symlinkTypeSync(srcpath, type) {
|
1697
|
+
if (type) return type;
|
1698
|
+
let stats;
|
1699
|
+
try {
|
1700
|
+
stats = fs.lstatSync(srcpath);
|
1701
|
+
} catch {
|
1702
|
+
return "file";
|
1837
1703
|
}
|
1838
|
-
|
1704
|
+
return stats && stats.isDirectory() ? "dir" : "file";
|
1839
1705
|
}
|
1840
|
-
|
1841
|
-
|
1842
|
-
|
1843
|
-
|
1844
|
-
|
1845
|
-
|
1846
|
-
|
1847
|
-
|
1848
|
-
|
1849
|
-
|
1850
|
-
|
1851
|
-
|
1852
|
-
|
1853
|
-
|
1854
|
-
|
1855
|
-
|
1856
|
-
|
1857
|
-
|
1858
|
-
|
1859
|
-
|
1860
|
-
|
1861
|
-
|
1862
|
-
var desiredDelay = Math.min(sinceStart * 1.2, 100);
|
1863
|
-
if (sinceAttempt >= desiredDelay) {
|
1864
|
-
debug("RETRY", fn.name, args);
|
1865
|
-
fn.apply(null, args.concat([startTime]));
|
1866
|
-
} else {
|
1867
|
-
fs[gracefulQueue].push(elem);
|
1868
|
-
}
|
1706
|
+
module2.exports = {
|
1707
|
+
symlinkType: u(symlinkType),
|
1708
|
+
symlinkTypeSync
|
1709
|
+
};
|
1710
|
+
}
|
1711
|
+
});
|
1712
|
+
var require_symlink = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
1713
|
+
"../../node_modules/.pnpm/fs-extra@11.3.0/node_modules/fs-extra/lib/ensure/symlink.js"(exports, module2) {
|
1714
|
+
"use strict";
|
1715
|
+
var u = require_universalify().fromPromise;
|
1716
|
+
var path = (0, import_chunk_WWAWV7DQ.__require)("path");
|
1717
|
+
var fs = require_fs();
|
1718
|
+
var { mkdirs, mkdirsSync } = require_mkdirs();
|
1719
|
+
var { symlinkPaths, symlinkPathsSync } = require_symlink_paths();
|
1720
|
+
var { symlinkType, symlinkTypeSync } = require_symlink_type();
|
1721
|
+
var { pathExists } = require_path_exists();
|
1722
|
+
var { areIdentical } = require_stat();
|
1723
|
+
async function createSymlink(srcpath, dstpath, type) {
|
1724
|
+
let stats;
|
1725
|
+
try {
|
1726
|
+
stats = await fs.lstat(dstpath);
|
1727
|
+
} catch {
|
1869
1728
|
}
|
1870
|
-
if (
|
1871
|
-
|
1729
|
+
if (stats && stats.isSymbolicLink()) {
|
1730
|
+
const [srcStat, dstStat] = await Promise.all([
|
1731
|
+
fs.stat(srcpath),
|
1732
|
+
fs.stat(dstpath)
|
1733
|
+
]);
|
1734
|
+
if (areIdentical(srcStat, dstStat)) return;
|
1735
|
+
}
|
1736
|
+
const relative = await symlinkPaths(srcpath, dstpath);
|
1737
|
+
srcpath = relative.toDst;
|
1738
|
+
const toType = await symlinkType(relative.toCwd, type);
|
1739
|
+
const dir = path.dirname(dstpath);
|
1740
|
+
if (!await pathExists(dir)) {
|
1741
|
+
await mkdirs(dir);
|
1742
|
+
}
|
1743
|
+
return fs.symlink(srcpath, dstpath, toType);
|
1744
|
+
}
|
1745
|
+
function createSymlinkSync(srcpath, dstpath, type) {
|
1746
|
+
let stats;
|
1747
|
+
try {
|
1748
|
+
stats = fs.lstatSync(dstpath);
|
1749
|
+
} catch {
|
1750
|
+
}
|
1751
|
+
if (stats && stats.isSymbolicLink()) {
|
1752
|
+
const srcStat = fs.statSync(srcpath);
|
1753
|
+
const dstStat = fs.statSync(dstpath);
|
1754
|
+
if (areIdentical(srcStat, dstStat)) return;
|
1872
1755
|
}
|
1756
|
+
const relative = symlinkPathsSync(srcpath, dstpath);
|
1757
|
+
srcpath = relative.toDst;
|
1758
|
+
type = symlinkTypeSync(relative.toCwd, type);
|
1759
|
+
const dir = path.dirname(dstpath);
|
1760
|
+
const exists = fs.existsSync(dir);
|
1761
|
+
if (exists) return fs.symlinkSync(srcpath, dstpath, type);
|
1762
|
+
mkdirsSync(dir);
|
1763
|
+
return fs.symlinkSync(srcpath, dstpath, type);
|
1873
1764
|
}
|
1765
|
+
module2.exports = {
|
1766
|
+
createSymlink: u(createSymlink),
|
1767
|
+
createSymlinkSync
|
1768
|
+
};
|
1769
|
+
}
|
1770
|
+
});
|
1771
|
+
var require_ensure = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
1772
|
+
"../../node_modules/.pnpm/fs-extra@11.3.0/node_modules/fs-extra/lib/ensure/index.js"(exports, module2) {
|
1773
|
+
"use strict";
|
1774
|
+
var { createFile, createFileSync } = require_file();
|
1775
|
+
var { createLink, createLinkSync } = require_link();
|
1776
|
+
var { createSymlink, createSymlinkSync } = require_symlink();
|
1777
|
+
module2.exports = {
|
1778
|
+
// file
|
1779
|
+
createFile,
|
1780
|
+
createFileSync,
|
1781
|
+
ensureFile: createFile,
|
1782
|
+
ensureFileSync: createFileSync,
|
1783
|
+
// link
|
1784
|
+
createLink,
|
1785
|
+
createLinkSync,
|
1786
|
+
ensureLink: createLink,
|
1787
|
+
ensureLinkSync: createLinkSync,
|
1788
|
+
// symlink
|
1789
|
+
createSymlink,
|
1790
|
+
createSymlinkSync,
|
1791
|
+
ensureSymlink: createSymlink,
|
1792
|
+
ensureSymlinkSync: createSymlinkSync
|
1793
|
+
};
|
1874
1794
|
}
|
1875
1795
|
});
|
1876
1796
|
var require_utils2 = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
@@ -1893,7 +1813,7 @@ var require_jsonfile = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
1893
1813
|
"use strict";
|
1894
1814
|
var _fs;
|
1895
1815
|
try {
|
1896
|
-
_fs =
|
1816
|
+
_fs = require_graceful_fs();
|
1897
1817
|
} catch (_) {
|
1898
1818
|
_fs = (0, import_chunk_WWAWV7DQ.__require)("fs");
|
1899
1819
|
}
|
@@ -1961,7 +1881,7 @@ var require_jsonfile = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
1961
1881
|
}
|
1962
1882
|
});
|
1963
1883
|
var require_jsonfile2 = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
1964
|
-
"../../node_modules/.pnpm/fs-extra@11.
|
1884
|
+
"../../node_modules/.pnpm/fs-extra@11.3.0/node_modules/fs-extra/lib/json/jsonfile.js"(exports, module2) {
|
1965
1885
|
"use strict";
|
1966
1886
|
var jsonFile = require_jsonfile();
|
1967
1887
|
module2.exports = {
|
@@ -1974,34 +1894,25 @@ var require_jsonfile2 = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
1974
1894
|
}
|
1975
1895
|
});
|
1976
1896
|
var require_output_file = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
1977
|
-
"../../node_modules/.pnpm/fs-extra@11.
|
1897
|
+
"../../node_modules/.pnpm/fs-extra@11.3.0/node_modules/fs-extra/lib/output-file/index.js"(exports, module2) {
|
1978
1898
|
"use strict";
|
1979
|
-
var u = require_universalify().
|
1980
|
-
var fs = (
|
1899
|
+
var u = require_universalify().fromPromise;
|
1900
|
+
var fs = require_fs();
|
1981
1901
|
var path = (0, import_chunk_WWAWV7DQ.__require)("path");
|
1982
1902
|
var mkdir = require_mkdirs();
|
1983
1903
|
var pathExists = require_path_exists().pathExists;
|
1984
|
-
function outputFile(file, data, encoding
|
1985
|
-
if (typeof encoding === "function") {
|
1986
|
-
callback = encoding;
|
1987
|
-
encoding = "utf8";
|
1988
|
-
}
|
1904
|
+
async function outputFile(file, data, encoding = "utf-8") {
|
1989
1905
|
const dir = path.dirname(file);
|
1990
|
-
pathExists(dir
|
1991
|
-
|
1992
|
-
|
1993
|
-
|
1994
|
-
if (err2) return callback(err2);
|
1995
|
-
fs.writeFile(file, data, encoding, callback);
|
1996
|
-
});
|
1997
|
-
});
|
1906
|
+
if (!await pathExists(dir)) {
|
1907
|
+
await mkdir.mkdirs(dir);
|
1908
|
+
}
|
1909
|
+
return fs.writeFile(file, data, encoding);
|
1998
1910
|
}
|
1999
1911
|
function outputFileSync(file, ...args) {
|
2000
1912
|
const dir = path.dirname(file);
|
2001
|
-
if (fs.existsSync(dir)) {
|
2002
|
-
|
1913
|
+
if (!fs.existsSync(dir)) {
|
1914
|
+
mkdir.mkdirsSync(dir);
|
2003
1915
|
}
|
2004
|
-
mkdir.mkdirsSync(dir);
|
2005
1916
|
fs.writeFileSync(file, ...args);
|
2006
1917
|
}
|
2007
1918
|
module2.exports = {
|
@@ -2011,7 +1922,7 @@ var require_output_file = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
2011
1922
|
}
|
2012
1923
|
});
|
2013
1924
|
var require_output_json = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
2014
|
-
"../../node_modules/.pnpm/fs-extra@11.
|
1925
|
+
"../../node_modules/.pnpm/fs-extra@11.3.0/node_modules/fs-extra/lib/json/output-json.js"(exports, module2) {
|
2015
1926
|
"use strict";
|
2016
1927
|
var { stringify } = require_utils2();
|
2017
1928
|
var { outputFile } = require_output_file();
|
@@ -2023,7 +1934,7 @@ var require_output_json = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
2023
1934
|
}
|
2024
1935
|
});
|
2025
1936
|
var require_output_json_sync = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
2026
|
-
"../../node_modules/.pnpm/fs-extra@11.
|
1937
|
+
"../../node_modules/.pnpm/fs-extra@11.3.0/node_modules/fs-extra/lib/json/output-json-sync.js"(exports, module2) {
|
2027
1938
|
"use strict";
|
2028
1939
|
var { stringify } = require_utils2();
|
2029
1940
|
var { outputFileSync } = require_output_file();
|
@@ -2035,7 +1946,7 @@ var require_output_json_sync = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
2035
1946
|
}
|
2036
1947
|
});
|
2037
1948
|
var require_json = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
2038
|
-
"../../node_modules/.pnpm/fs-extra@11.
|
1949
|
+
"../../node_modules/.pnpm/fs-extra@11.3.0/node_modules/fs-extra/lib/json/index.js"(exports, module2) {
|
2039
1950
|
"use strict";
|
2040
1951
|
var u = require_universalify().fromPromise;
|
2041
1952
|
var jsonFile = require_jsonfile2();
|
@@ -2051,79 +1962,59 @@ var require_json = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
2051
1962
|
}
|
2052
1963
|
});
|
2053
1964
|
var require_move = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
2054
|
-
"../../node_modules/.pnpm/fs-extra@11.
|
1965
|
+
"../../node_modules/.pnpm/fs-extra@11.3.0/node_modules/fs-extra/lib/move/move.js"(exports, module2) {
|
2055
1966
|
"use strict";
|
2056
|
-
var fs = (
|
1967
|
+
var fs = require_fs();
|
2057
1968
|
var path = (0, import_chunk_WWAWV7DQ.__require)("path");
|
2058
|
-
var copy = require_copy2()
|
2059
|
-
var remove = require_remove()
|
2060
|
-
var mkdirp = require_mkdirs()
|
2061
|
-
var pathExists = require_path_exists()
|
1969
|
+
var { copy } = require_copy2();
|
1970
|
+
var { remove } = require_remove();
|
1971
|
+
var { mkdirp } = require_mkdirs();
|
1972
|
+
var { pathExists } = require_path_exists();
|
2062
1973
|
var stat = require_stat();
|
2063
|
-
function move(src, dest, opts
|
2064
|
-
if (typeof opts === "function") {
|
2065
|
-
cb = opts;
|
2066
|
-
opts = {};
|
2067
|
-
}
|
2068
|
-
opts = opts || {};
|
1974
|
+
async function move(src, dest, opts = {}) {
|
2069
1975
|
const overwrite = opts.overwrite || opts.clobber || false;
|
2070
|
-
stat.checkPaths(src, dest, "move", opts
|
2071
|
-
|
2072
|
-
|
2073
|
-
|
2074
|
-
|
2075
|
-
|
2076
|
-
mkdirp(path.dirname(dest), (err3) => {
|
2077
|
-
if (err3) return cb(err3);
|
2078
|
-
return doRename(src, dest, overwrite, isChangingCase, cb);
|
2079
|
-
});
|
2080
|
-
});
|
2081
|
-
});
|
2082
|
-
}
|
2083
|
-
function isParentRoot(dest) {
|
2084
|
-
const parent = path.dirname(dest);
|
2085
|
-
const parsedPath = path.parse(parent);
|
2086
|
-
return parsedPath.root === parent;
|
2087
|
-
}
|
2088
|
-
function doRename(src, dest, overwrite, isChangingCase, cb) {
|
2089
|
-
if (isChangingCase) return rename(src, dest, overwrite, cb);
|
2090
|
-
if (overwrite) {
|
2091
|
-
return remove(dest, (err) => {
|
2092
|
-
if (err) return cb(err);
|
2093
|
-
return rename(src, dest, overwrite, cb);
|
2094
|
-
});
|
1976
|
+
const { srcStat, isChangingCase = false } = await stat.checkPaths(src, dest, "move", opts);
|
1977
|
+
await stat.checkParentPaths(src, srcStat, dest, "move");
|
1978
|
+
const destParent = path.dirname(dest);
|
1979
|
+
const parsedParentPath = path.parse(destParent);
|
1980
|
+
if (parsedParentPath.root !== destParent) {
|
1981
|
+
await mkdirp(destParent);
|
2095
1982
|
}
|
2096
|
-
|
2097
|
-
if (err) return cb(err);
|
2098
|
-
if (destExists) return cb(new Error("dest already exists."));
|
2099
|
-
return rename(src, dest, overwrite, cb);
|
2100
|
-
});
|
1983
|
+
return doRename(src, dest, overwrite, isChangingCase);
|
2101
1984
|
}
|
2102
|
-
function
|
2103
|
-
|
2104
|
-
if (
|
2105
|
-
|
2106
|
-
|
2107
|
-
|
1985
|
+
async function doRename(src, dest, overwrite, isChangingCase) {
|
1986
|
+
if (!isChangingCase) {
|
1987
|
+
if (overwrite) {
|
1988
|
+
await remove(dest);
|
1989
|
+
} else if (await pathExists(dest)) {
|
1990
|
+
throw new Error("dest already exists.");
|
1991
|
+
}
|
1992
|
+
}
|
1993
|
+
try {
|
1994
|
+
await fs.rename(src, dest);
|
1995
|
+
} catch (err) {
|
1996
|
+
if (err.code !== "EXDEV") {
|
1997
|
+
throw err;
|
1998
|
+
}
|
1999
|
+
await moveAcrossDevice(src, dest, overwrite);
|
2000
|
+
}
|
2108
2001
|
}
|
2109
|
-
function moveAcrossDevice(src, dest, overwrite
|
2002
|
+
async function moveAcrossDevice(src, dest, overwrite) {
|
2110
2003
|
const opts = {
|
2111
2004
|
overwrite,
|
2112
2005
|
errorOnExist: true,
|
2113
2006
|
preserveTimestamps: true
|
2114
2007
|
};
|
2115
|
-
copy(src, dest, opts
|
2116
|
-
|
2117
|
-
return remove(src, cb);
|
2118
|
-
});
|
2008
|
+
await copy(src, dest, opts);
|
2009
|
+
return remove(src);
|
2119
2010
|
}
|
2120
2011
|
module2.exports = move;
|
2121
2012
|
}
|
2122
2013
|
});
|
2123
2014
|
var require_move_sync = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
2124
|
-
"../../node_modules/.pnpm/fs-extra@11.
|
2015
|
+
"../../node_modules/.pnpm/fs-extra@11.3.0/node_modules/fs-extra/lib/move/move-sync.js"(exports, module2) {
|
2125
2016
|
"use strict";
|
2126
|
-
var fs =
|
2017
|
+
var fs = require_graceful_fs();
|
2127
2018
|
var path = (0, import_chunk_WWAWV7DQ.__require)("path");
|
2128
2019
|
var copySync = require_copy2().copySync;
|
2129
2020
|
var removeSync = require_remove().removeSync;
|
@@ -2172,9 +2063,9 @@ var require_move_sync = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
2172
2063
|
}
|
2173
2064
|
});
|
2174
2065
|
var require_move2 = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
2175
|
-
"../../node_modules/.pnpm/fs-extra@11.
|
2066
|
+
"../../node_modules/.pnpm/fs-extra@11.3.0/node_modules/fs-extra/lib/move/index.js"(exports, module2) {
|
2176
2067
|
"use strict";
|
2177
|
-
var u = require_universalify().
|
2068
|
+
var u = require_universalify().fromPromise;
|
2178
2069
|
module2.exports = {
|
2179
2070
|
move: u(require_move()),
|
2180
2071
|
moveSync: require_move_sync()
|
@@ -2182,7 +2073,7 @@ var require_move2 = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
2182
2073
|
}
|
2183
2074
|
});
|
2184
2075
|
var require_lib = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
2185
|
-
"../../node_modules/.pnpm/fs-extra@11.
|
2076
|
+
"../../node_modules/.pnpm/fs-extra@11.3.0/node_modules/fs-extra/lib/index.js"(exports, module2) {
|
2186
2077
|
"use strict";
|
2187
2078
|
module2.exports = {
|
2188
2079
|
// Export promiseified graceful-fs:
|