@aws-cdk/integ-runner 2.197.13 → 2.197.15
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/.yarnrc.yml +3 -0
- package/THIRD_PARTY_LICENSES +59 -70
- package/lib/index.js +722 -1086
- package/lib/runner/runner-base.d.ts.map +1 -1
- package/lib/runner/runner-base.js +2 -3
- package/lib/workers/extract/index.js +84365 -84769
- package/package.json +39 -39
package/lib/index.js
CHANGED
|
@@ -3543,9 +3543,9 @@ var require_graceful_fs = __commonJS({
|
|
|
3543
3543
|
}
|
|
3544
3544
|
});
|
|
3545
3545
|
|
|
3546
|
-
// node_modules/fs-extra/lib/fs/index.js
|
|
3546
|
+
// ../../../node_modules/fs-extra/lib/fs/index.js
|
|
3547
3547
|
var require_fs = __commonJS({
|
|
3548
|
-
"node_modules/fs-extra/lib/fs/index.js"(exports2) {
|
|
3548
|
+
"../../../node_modules/fs-extra/lib/fs/index.js"(exports2) {
|
|
3549
3549
|
"use strict";
|
|
3550
3550
|
var u = require_universalify().fromCallback;
|
|
3551
3551
|
var fs3 = require_graceful_fs();
|
|
@@ -3556,6 +3556,7 @@ var require_fs = __commonJS({
|
|
|
3556
3556
|
"chown",
|
|
3557
3557
|
"close",
|
|
3558
3558
|
"copyFile",
|
|
3559
|
+
"cp",
|
|
3559
3560
|
"fchmod",
|
|
3560
3561
|
"fchown",
|
|
3561
3562
|
"fdatasync",
|
|
@@ -3563,8 +3564,10 @@ var require_fs = __commonJS({
|
|
|
3563
3564
|
"fsync",
|
|
3564
3565
|
"ftruncate",
|
|
3565
3566
|
"futimes",
|
|
3567
|
+
"glob",
|
|
3566
3568
|
"lchmod",
|
|
3567
3569
|
"lchown",
|
|
3570
|
+
"lutimes",
|
|
3568
3571
|
"link",
|
|
3569
3572
|
"lstat",
|
|
3570
3573
|
"mkdir",
|
|
@@ -3579,6 +3582,7 @@ var require_fs = __commonJS({
|
|
|
3579
3582
|
"rm",
|
|
3580
3583
|
"rmdir",
|
|
3581
3584
|
"stat",
|
|
3585
|
+
"statfs",
|
|
3582
3586
|
"symlink",
|
|
3583
3587
|
"truncate",
|
|
3584
3588
|
"unlink",
|
|
@@ -3587,12 +3591,7 @@ var require_fs = __commonJS({
|
|
|
3587
3591
|
].filter((key) => {
|
|
3588
3592
|
return typeof fs3[key] === "function";
|
|
3589
3593
|
});
|
|
3590
|
-
Object.
|
|
3591
|
-
if (key === "promises") {
|
|
3592
|
-
return;
|
|
3593
|
-
}
|
|
3594
|
-
exports2[key] = fs3[key];
|
|
3595
|
-
});
|
|
3594
|
+
Object.assign(exports2, fs3);
|
|
3596
3595
|
api.forEach((method) => {
|
|
3597
3596
|
exports2[method] = u(fs3[method]);
|
|
3598
3597
|
});
|
|
@@ -3626,45 +3625,46 @@ var require_fs = __commonJS({
|
|
|
3626
3625
|
});
|
|
3627
3626
|
});
|
|
3628
3627
|
};
|
|
3629
|
-
|
|
3630
|
-
|
|
3631
|
-
|
|
3632
|
-
|
|
3633
|
-
|
|
3634
|
-
|
|
3635
|
-
|
|
3636
|
-
|
|
3637
|
-
resolve3({ bytesWritten, buffers: buffers2 });
|
|
3638
|
-
});
|
|
3628
|
+
exports2.readv = function(fd, buffers, ...args) {
|
|
3629
|
+
if (typeof args[args.length - 1] === "function") {
|
|
3630
|
+
return fs3.readv(fd, buffers, ...args);
|
|
3631
|
+
}
|
|
3632
|
+
return new Promise((resolve3, reject) => {
|
|
3633
|
+
fs3.readv(fd, buffers, ...args, (err, bytesRead, buffers2) => {
|
|
3634
|
+
if (err) return reject(err);
|
|
3635
|
+
resolve3({ bytesRead, buffers: buffers2 });
|
|
3639
3636
|
});
|
|
3640
|
-
};
|
|
3641
|
-
}
|
|
3637
|
+
});
|
|
3638
|
+
};
|
|
3639
|
+
exports2.writev = function(fd, buffers, ...args) {
|
|
3640
|
+
if (typeof args[args.length - 1] === "function") {
|
|
3641
|
+
return fs3.writev(fd, buffers, ...args);
|
|
3642
|
+
}
|
|
3643
|
+
return new Promise((resolve3, reject) => {
|
|
3644
|
+
fs3.writev(fd, buffers, ...args, (err, bytesWritten, buffers2) => {
|
|
3645
|
+
if (err) return reject(err);
|
|
3646
|
+
resolve3({ bytesWritten, buffers: buffers2 });
|
|
3647
|
+
});
|
|
3648
|
+
});
|
|
3649
|
+
};
|
|
3642
3650
|
if (typeof fs3.realpath.native === "function") {
|
|
3643
3651
|
exports2.realpath.native = u(fs3.realpath.native);
|
|
3652
|
+
} else {
|
|
3653
|
+
process.emitWarning(
|
|
3654
|
+
"fs.realpath.native is not a function. Is fs being monkey-patched?",
|
|
3655
|
+
"Warning",
|
|
3656
|
+
"fs-extra-WARN0003"
|
|
3657
|
+
);
|
|
3644
3658
|
}
|
|
3645
3659
|
}
|
|
3646
3660
|
});
|
|
3647
3661
|
|
|
3648
|
-
// ../../../node_modules/
|
|
3649
|
-
var
|
|
3650
|
-
"../../../node_modules/
|
|
3651
|
-
module2.exports = (r) => {
|
|
3652
|
-
const n = process.versions.node.split(".").map((x) => parseInt(x, 10));
|
|
3653
|
-
r = r.split(".").map((x) => parseInt(x, 10));
|
|
3654
|
-
return n[0] > r[0] || n[0] === r[0] && (n[1] > r[1] || n[1] === r[1] && n[2] >= r[2]);
|
|
3655
|
-
};
|
|
3656
|
-
}
|
|
3657
|
-
});
|
|
3658
|
-
|
|
3659
|
-
// node_modules/fs-extra/lib/mkdirs/make-dir.js
|
|
3660
|
-
var require_make_dir = __commonJS({
|
|
3661
|
-
"node_modules/fs-extra/lib/mkdirs/make-dir.js"(exports2, module2) {
|
|
3662
|
+
// ../../../node_modules/fs-extra/lib/mkdirs/utils.js
|
|
3663
|
+
var require_utils = __commonJS({
|
|
3664
|
+
"../../../node_modules/fs-extra/lib/mkdirs/utils.js"(exports2, module2) {
|
|
3662
3665
|
"use strict";
|
|
3663
|
-
var fs3 = require_fs();
|
|
3664
3666
|
var path3 = require("path");
|
|
3665
|
-
|
|
3666
|
-
var useNativeRecursiveOption = atLeastNode("10.12.0");
|
|
3667
|
-
var checkPath = /* @__PURE__ */ __name((pth) => {
|
|
3667
|
+
module2.exports.checkPath = /* @__PURE__ */ __name(function checkPath(pth) {
|
|
3668
3668
|
if (process.platform === "win32") {
|
|
3669
3669
|
const pathHasInvalidWinCharacters = /[<>:"|?*]/.test(pth.replace(path3.parse(pth).root, ""));
|
|
3670
3670
|
if (pathHasInvalidWinCharacters) {
|
|
@@ -3674,102 +3674,40 @@ var require_make_dir = __commonJS({
|
|
|
3674
3674
|
}
|
|
3675
3675
|
}
|
|
3676
3676
|
}, "checkPath");
|
|
3677
|
-
|
|
3677
|
+
}
|
|
3678
|
+
});
|
|
3679
|
+
|
|
3680
|
+
// ../../../node_modules/fs-extra/lib/mkdirs/make-dir.js
|
|
3681
|
+
var require_make_dir = __commonJS({
|
|
3682
|
+
"../../../node_modules/fs-extra/lib/mkdirs/make-dir.js"(exports2, module2) {
|
|
3683
|
+
"use strict";
|
|
3684
|
+
var fs3 = require_fs();
|
|
3685
|
+
var { checkPath } = require_utils();
|
|
3686
|
+
var getMode = /* @__PURE__ */ __name((options) => {
|
|
3678
3687
|
const defaults = { mode: 511 };
|
|
3679
|
-
if (typeof options === "number")
|
|
3680
|
-
return { ...defaults, ...options };
|
|
3681
|
-
}, "
|
|
3682
|
-
|
|
3683
|
-
|
|
3684
|
-
|
|
3685
|
-
|
|
3686
|
-
|
|
3687
|
-
|
|
3688
|
-
return error2;
|
|
3689
|
-
}, "permissionError");
|
|
3690
|
-
module2.exports.makeDir = async (input, options) => {
|
|
3691
|
-
checkPath(input);
|
|
3692
|
-
options = processOptions(options);
|
|
3693
|
-
if (useNativeRecursiveOption) {
|
|
3694
|
-
const pth = path3.resolve(input);
|
|
3695
|
-
return fs3.mkdir(pth, {
|
|
3696
|
-
mode: options.mode,
|
|
3697
|
-
recursive: true
|
|
3698
|
-
});
|
|
3699
|
-
}
|
|
3700
|
-
const make = /* @__PURE__ */ __name(async (pth) => {
|
|
3701
|
-
try {
|
|
3702
|
-
await fs3.mkdir(pth, options.mode);
|
|
3703
|
-
} catch (error2) {
|
|
3704
|
-
if (error2.code === "EPERM") {
|
|
3705
|
-
throw error2;
|
|
3706
|
-
}
|
|
3707
|
-
if (error2.code === "ENOENT") {
|
|
3708
|
-
if (path3.dirname(pth) === pth) {
|
|
3709
|
-
throw permissionError(pth);
|
|
3710
|
-
}
|
|
3711
|
-
if (error2.message.includes("null bytes")) {
|
|
3712
|
-
throw error2;
|
|
3713
|
-
}
|
|
3714
|
-
await make(path3.dirname(pth));
|
|
3715
|
-
return make(pth);
|
|
3716
|
-
}
|
|
3717
|
-
try {
|
|
3718
|
-
const stats = await fs3.stat(pth);
|
|
3719
|
-
if (!stats.isDirectory()) {
|
|
3720
|
-
throw new Error("The path is not a directory");
|
|
3721
|
-
}
|
|
3722
|
-
} catch {
|
|
3723
|
-
throw error2;
|
|
3724
|
-
}
|
|
3725
|
-
}
|
|
3726
|
-
}, "make");
|
|
3727
|
-
return make(path3.resolve(input));
|
|
3688
|
+
if (typeof options === "number") return options;
|
|
3689
|
+
return { ...defaults, ...options }.mode;
|
|
3690
|
+
}, "getMode");
|
|
3691
|
+
module2.exports.makeDir = async (dir, options) => {
|
|
3692
|
+
checkPath(dir);
|
|
3693
|
+
return fs3.mkdir(dir, {
|
|
3694
|
+
mode: getMode(options),
|
|
3695
|
+
recursive: true
|
|
3696
|
+
});
|
|
3728
3697
|
};
|
|
3729
|
-
module2.exports.makeDirSync = (
|
|
3730
|
-
checkPath(
|
|
3731
|
-
|
|
3732
|
-
|
|
3733
|
-
|
|
3734
|
-
|
|
3735
|
-
mode: options.mode,
|
|
3736
|
-
recursive: true
|
|
3737
|
-
});
|
|
3738
|
-
}
|
|
3739
|
-
const make = /* @__PURE__ */ __name((pth) => {
|
|
3740
|
-
try {
|
|
3741
|
-
fs3.mkdirSync(pth, options.mode);
|
|
3742
|
-
} catch (error2) {
|
|
3743
|
-
if (error2.code === "EPERM") {
|
|
3744
|
-
throw error2;
|
|
3745
|
-
}
|
|
3746
|
-
if (error2.code === "ENOENT") {
|
|
3747
|
-
if (path3.dirname(pth) === pth) {
|
|
3748
|
-
throw permissionError(pth);
|
|
3749
|
-
}
|
|
3750
|
-
if (error2.message.includes("null bytes")) {
|
|
3751
|
-
throw error2;
|
|
3752
|
-
}
|
|
3753
|
-
make(path3.dirname(pth));
|
|
3754
|
-
return make(pth);
|
|
3755
|
-
}
|
|
3756
|
-
try {
|
|
3757
|
-
if (!fs3.statSync(pth).isDirectory()) {
|
|
3758
|
-
throw new Error("The path is not a directory");
|
|
3759
|
-
}
|
|
3760
|
-
} catch {
|
|
3761
|
-
throw error2;
|
|
3762
|
-
}
|
|
3763
|
-
}
|
|
3764
|
-
}, "make");
|
|
3765
|
-
return make(path3.resolve(input));
|
|
3698
|
+
module2.exports.makeDirSync = (dir, options) => {
|
|
3699
|
+
checkPath(dir);
|
|
3700
|
+
return fs3.mkdirSync(dir, {
|
|
3701
|
+
mode: getMode(options),
|
|
3702
|
+
recursive: true
|
|
3703
|
+
});
|
|
3766
3704
|
};
|
|
3767
3705
|
}
|
|
3768
3706
|
});
|
|
3769
3707
|
|
|
3770
|
-
// node_modules/fs-extra/lib/mkdirs/index.js
|
|
3708
|
+
// ../../../node_modules/fs-extra/lib/mkdirs/index.js
|
|
3771
3709
|
var require_mkdirs = __commonJS({
|
|
3772
|
-
"node_modules/fs-extra/lib/mkdirs/index.js"(exports2, module2) {
|
|
3710
|
+
"../../../node_modules/fs-extra/lib/mkdirs/index.js"(exports2, module2) {
|
|
3773
3711
|
"use strict";
|
|
3774
3712
|
var u = require_universalify().fromPromise;
|
|
3775
3713
|
var { makeDir: _makeDir, makeDirSync } = require_make_dir();
|
|
@@ -3786,20 +3724,44 @@ var require_mkdirs = __commonJS({
|
|
|
3786
3724
|
}
|
|
3787
3725
|
});
|
|
3788
3726
|
|
|
3789
|
-
// node_modules/fs-extra/lib/
|
|
3727
|
+
// ../../../node_modules/fs-extra/lib/path-exists/index.js
|
|
3728
|
+
var require_path_exists = __commonJS({
|
|
3729
|
+
"../../../node_modules/fs-extra/lib/path-exists/index.js"(exports2, module2) {
|
|
3730
|
+
"use strict";
|
|
3731
|
+
var u = require_universalify().fromPromise;
|
|
3732
|
+
var fs3 = require_fs();
|
|
3733
|
+
function pathExists(path3) {
|
|
3734
|
+
return fs3.access(path3).then(() => true).catch(() => false);
|
|
3735
|
+
}
|
|
3736
|
+
__name(pathExists, "pathExists");
|
|
3737
|
+
module2.exports = {
|
|
3738
|
+
pathExists: u(pathExists),
|
|
3739
|
+
pathExistsSync: fs3.existsSync
|
|
3740
|
+
};
|
|
3741
|
+
}
|
|
3742
|
+
});
|
|
3743
|
+
|
|
3744
|
+
// ../../../node_modules/fs-extra/lib/util/utimes.js
|
|
3790
3745
|
var require_utimes = __commonJS({
|
|
3791
|
-
"node_modules/fs-extra/lib/util/utimes.js"(exports2, module2) {
|
|
3746
|
+
"../../../node_modules/fs-extra/lib/util/utimes.js"(exports2, module2) {
|
|
3792
3747
|
"use strict";
|
|
3793
|
-
var fs3 =
|
|
3794
|
-
|
|
3795
|
-
|
|
3796
|
-
|
|
3797
|
-
|
|
3798
|
-
|
|
3799
|
-
|
|
3800
|
-
|
|
3801
|
-
|
|
3802
|
-
|
|
3748
|
+
var fs3 = require_fs();
|
|
3749
|
+
var u = require_universalify().fromPromise;
|
|
3750
|
+
async function utimesMillis(path3, atime, mtime) {
|
|
3751
|
+
const fd = await fs3.open(path3, "r+");
|
|
3752
|
+
let closeErr = null;
|
|
3753
|
+
try {
|
|
3754
|
+
await fs3.futimes(fd, atime, mtime);
|
|
3755
|
+
} finally {
|
|
3756
|
+
try {
|
|
3757
|
+
await fs3.close(fd);
|
|
3758
|
+
} catch (e) {
|
|
3759
|
+
closeErr = e;
|
|
3760
|
+
}
|
|
3761
|
+
}
|
|
3762
|
+
if (closeErr) {
|
|
3763
|
+
throw closeErr;
|
|
3764
|
+
}
|
|
3803
3765
|
}
|
|
3804
3766
|
__name(utimesMillis, "utimesMillis");
|
|
3805
3767
|
function utimesMillisSync(path3, atime, mtime) {
|
|
@@ -3809,38 +3771,36 @@ var require_utimes = __commonJS({
|
|
|
3809
3771
|
}
|
|
3810
3772
|
__name(utimesMillisSync, "utimesMillisSync");
|
|
3811
3773
|
module2.exports = {
|
|
3812
|
-
utimesMillis,
|
|
3774
|
+
utimesMillis: u(utimesMillis),
|
|
3813
3775
|
utimesMillisSync
|
|
3814
3776
|
};
|
|
3815
3777
|
}
|
|
3816
3778
|
});
|
|
3817
3779
|
|
|
3818
|
-
// node_modules/fs-extra/lib/util/stat.js
|
|
3780
|
+
// ../../../node_modules/fs-extra/lib/util/stat.js
|
|
3819
3781
|
var require_stat = __commonJS({
|
|
3820
|
-
"node_modules/fs-extra/lib/util/stat.js"(exports2, module2) {
|
|
3782
|
+
"../../../node_modules/fs-extra/lib/util/stat.js"(exports2, module2) {
|
|
3821
3783
|
"use strict";
|
|
3822
3784
|
var fs3 = require_fs();
|
|
3823
3785
|
var path3 = require("path");
|
|
3824
|
-
var
|
|
3825
|
-
|
|
3826
|
-
|
|
3827
|
-
var stat2 = /* @__PURE__ */ __name((file) => nodeSupportsBigInt ? fs3.stat(file, { bigint: true }) : fs3.stat(file), "stat");
|
|
3828
|
-
var statSync = /* @__PURE__ */ __name((file) => nodeSupportsBigInt ? fs3.statSync(file, { bigint: true }) : fs3.statSync(file), "statSync");
|
|
3829
|
-
function getStats(src, dest) {
|
|
3786
|
+
var u = require_universalify().fromPromise;
|
|
3787
|
+
function getStats(src, dest, opts) {
|
|
3788
|
+
const statFunc = opts.dereference ? (file) => fs3.stat(file, { bigint: true }) : (file) => fs3.lstat(file, { bigint: true });
|
|
3830
3789
|
return Promise.all([
|
|
3831
|
-
|
|
3832
|
-
|
|
3790
|
+
statFunc(src),
|
|
3791
|
+
statFunc(dest).catch((err) => {
|
|
3833
3792
|
if (err.code === "ENOENT") return null;
|
|
3834
3793
|
throw err;
|
|
3835
3794
|
})
|
|
3836
3795
|
]).then(([srcStat, destStat]) => ({ srcStat, destStat }));
|
|
3837
3796
|
}
|
|
3838
3797
|
__name(getStats, "getStats");
|
|
3839
|
-
function getStatsSync(src, dest) {
|
|
3798
|
+
function getStatsSync(src, dest, opts) {
|
|
3840
3799
|
let destStat;
|
|
3841
|
-
const
|
|
3800
|
+
const statFunc = opts.dereference ? (file) => fs3.statSync(file, { bigint: true }) : (file) => fs3.lstatSync(file, { bigint: true });
|
|
3801
|
+
const srcStat = statFunc(src);
|
|
3842
3802
|
try {
|
|
3843
|
-
destStat =
|
|
3803
|
+
destStat = statFunc(dest);
|
|
3844
3804
|
} catch (err) {
|
|
3845
3805
|
if (err.code === "ENOENT") return { srcStat, destStat: null };
|
|
3846
3806
|
throw err;
|
|
@@ -3848,24 +3808,47 @@ var require_stat = __commonJS({
|
|
|
3848
3808
|
return { srcStat, destStat };
|
|
3849
3809
|
}
|
|
3850
3810
|
__name(getStatsSync, "getStatsSync");
|
|
3851
|
-
function checkPaths(src, dest, funcName,
|
|
3852
|
-
|
|
3853
|
-
|
|
3854
|
-
|
|
3855
|
-
|
|
3856
|
-
|
|
3811
|
+
async function checkPaths(src, dest, funcName, opts) {
|
|
3812
|
+
const { srcStat, destStat } = await getStats(src, dest, opts);
|
|
3813
|
+
if (destStat) {
|
|
3814
|
+
if (areIdentical(srcStat, destStat)) {
|
|
3815
|
+
const srcBaseName = path3.basename(src);
|
|
3816
|
+
const destBaseName = path3.basename(dest);
|
|
3817
|
+
if (funcName === "move" && srcBaseName !== destBaseName && srcBaseName.toLowerCase() === destBaseName.toLowerCase()) {
|
|
3818
|
+
return { srcStat, destStat, isChangingCase: true };
|
|
3819
|
+
}
|
|
3820
|
+
throw new Error("Source and destination must not be the same.");
|
|
3857
3821
|
}
|
|
3858
|
-
if (srcStat.isDirectory() &&
|
|
3859
|
-
|
|
3822
|
+
if (srcStat.isDirectory() && !destStat.isDirectory()) {
|
|
3823
|
+
throw new Error(`Cannot overwrite non-directory '${dest}' with directory '${src}'.`);
|
|
3860
3824
|
}
|
|
3861
|
-
|
|
3862
|
-
|
|
3825
|
+
if (!srcStat.isDirectory() && destStat.isDirectory()) {
|
|
3826
|
+
throw new Error(`Cannot overwrite directory '${dest}' with non-directory '${src}'.`);
|
|
3827
|
+
}
|
|
3828
|
+
}
|
|
3829
|
+
if (srcStat.isDirectory() && isSrcSubdir(src, dest)) {
|
|
3830
|
+
throw new Error(errMsg(src, dest, funcName));
|
|
3831
|
+
}
|
|
3832
|
+
return { srcStat, destStat };
|
|
3863
3833
|
}
|
|
3864
3834
|
__name(checkPaths, "checkPaths");
|
|
3865
|
-
function checkPathsSync(src, dest, funcName) {
|
|
3866
|
-
const { srcStat, destStat } = getStatsSync(src, dest);
|
|
3867
|
-
if (destStat
|
|
3868
|
-
|
|
3835
|
+
function checkPathsSync(src, dest, funcName, opts) {
|
|
3836
|
+
const { srcStat, destStat } = getStatsSync(src, dest, opts);
|
|
3837
|
+
if (destStat) {
|
|
3838
|
+
if (areIdentical(srcStat, destStat)) {
|
|
3839
|
+
const srcBaseName = path3.basename(src);
|
|
3840
|
+
const destBaseName = path3.basename(dest);
|
|
3841
|
+
if (funcName === "move" && srcBaseName !== destBaseName && srcBaseName.toLowerCase() === destBaseName.toLowerCase()) {
|
|
3842
|
+
return { srcStat, destStat, isChangingCase: true };
|
|
3843
|
+
}
|
|
3844
|
+
throw new Error("Source and destination must not be the same.");
|
|
3845
|
+
}
|
|
3846
|
+
if (srcStat.isDirectory() && !destStat.isDirectory()) {
|
|
3847
|
+
throw new Error(`Cannot overwrite non-directory '${dest}' with directory '${src}'.`);
|
|
3848
|
+
}
|
|
3849
|
+
if (!srcStat.isDirectory() && destStat.isDirectory()) {
|
|
3850
|
+
throw new Error(`Cannot overwrite directory '${dest}' with non-directory '${src}'.`);
|
|
3851
|
+
}
|
|
3869
3852
|
}
|
|
3870
3853
|
if (srcStat.isDirectory() && isSrcSubdir(src, dest)) {
|
|
3871
3854
|
throw new Error(errMsg(src, dest, funcName));
|
|
@@ -3873,22 +3856,21 @@ var require_stat = __commonJS({
|
|
|
3873
3856
|
return { srcStat, destStat };
|
|
3874
3857
|
}
|
|
3875
3858
|
__name(checkPathsSync, "checkPathsSync");
|
|
3876
|
-
function checkParentPaths(src, srcStat, dest, funcName
|
|
3859
|
+
async function checkParentPaths(src, srcStat, dest, funcName) {
|
|
3877
3860
|
const srcParent = path3.resolve(path3.dirname(src));
|
|
3878
3861
|
const destParent = path3.resolve(path3.dirname(dest));
|
|
3879
|
-
if (destParent === srcParent || destParent === path3.parse(destParent).root) return
|
|
3880
|
-
|
|
3881
|
-
|
|
3882
|
-
|
|
3883
|
-
|
|
3884
|
-
|
|
3885
|
-
|
|
3886
|
-
|
|
3887
|
-
|
|
3888
|
-
|
|
3889
|
-
}
|
|
3890
|
-
|
|
3891
|
-
else fs3.stat(destParent, callback);
|
|
3862
|
+
if (destParent === srcParent || destParent === path3.parse(destParent).root) return;
|
|
3863
|
+
let destStat;
|
|
3864
|
+
try {
|
|
3865
|
+
destStat = await fs3.stat(destParent, { bigint: true });
|
|
3866
|
+
} catch (err) {
|
|
3867
|
+
if (err.code === "ENOENT") return;
|
|
3868
|
+
throw err;
|
|
3869
|
+
}
|
|
3870
|
+
if (areIdentical(srcStat, destStat)) {
|
|
3871
|
+
throw new Error(errMsg(src, dest, funcName));
|
|
3872
|
+
}
|
|
3873
|
+
return checkParentPaths(src, srcStat, destParent, funcName);
|
|
3892
3874
|
}
|
|
3893
3875
|
__name(checkParentPaths, "checkParentPaths");
|
|
3894
3876
|
function checkParentPathsSync(src, srcStat, dest, funcName) {
|
|
@@ -3897,7 +3879,7 @@ var require_stat = __commonJS({
|
|
|
3897
3879
|
if (destParent === srcParent || destParent === path3.parse(destParent).root) return;
|
|
3898
3880
|
let destStat;
|
|
3899
3881
|
try {
|
|
3900
|
-
destStat = statSync(destParent);
|
|
3882
|
+
destStat = fs3.statSync(destParent, { bigint: true });
|
|
3901
3883
|
} catch (err) {
|
|
3902
3884
|
if (err.code === "ENOENT") return;
|
|
3903
3885
|
throw err;
|
|
@@ -3909,21 +3891,13 @@ var require_stat = __commonJS({
|
|
|
3909
3891
|
}
|
|
3910
3892
|
__name(checkParentPathsSync, "checkParentPathsSync");
|
|
3911
3893
|
function areIdentical(srcStat, destStat) {
|
|
3912
|
-
|
|
3913
|
-
if (nodeSupportsBigInt || destStat.ino < Number.MAX_SAFE_INTEGER) {
|
|
3914
|
-
return true;
|
|
3915
|
-
}
|
|
3916
|
-
if (destStat.size === srcStat.size && destStat.mode === srcStat.mode && destStat.nlink === srcStat.nlink && destStat.atimeMs === srcStat.atimeMs && destStat.mtimeMs === srcStat.mtimeMs && destStat.ctimeMs === srcStat.ctimeMs && destStat.birthtimeMs === srcStat.birthtimeMs) {
|
|
3917
|
-
return true;
|
|
3918
|
-
}
|
|
3919
|
-
}
|
|
3920
|
-
return false;
|
|
3894
|
+
return destStat.ino !== void 0 && destStat.dev !== void 0 && destStat.ino === srcStat.ino && destStat.dev === srcStat.dev;
|
|
3921
3895
|
}
|
|
3922
3896
|
__name(areIdentical, "areIdentical");
|
|
3923
3897
|
function isSrcSubdir(src, dest) {
|
|
3924
3898
|
const srcArr = path3.resolve(src).split(path3.sep).filter((i) => i);
|
|
3925
3899
|
const destArr = path3.resolve(dest).split(path3.sep).filter((i) => i);
|
|
3926
|
-
return srcArr.
|
|
3900
|
+
return srcArr.every((cur, i) => destArr[i] === cur);
|
|
3927
3901
|
}
|
|
3928
3902
|
__name(isSrcSubdir, "isSrcSubdir");
|
|
3929
3903
|
function errMsg(src, dest, funcName) {
|
|
@@ -3931,18 +3905,186 @@ var require_stat = __commonJS({
|
|
|
3931
3905
|
}
|
|
3932
3906
|
__name(errMsg, "errMsg");
|
|
3933
3907
|
module2.exports = {
|
|
3934
|
-
checkPaths
|
|
3908
|
+
// checkPaths
|
|
3909
|
+
checkPaths: u(checkPaths),
|
|
3935
3910
|
checkPathsSync,
|
|
3936
|
-
|
|
3911
|
+
// checkParent
|
|
3912
|
+
checkParentPaths: u(checkParentPaths),
|
|
3937
3913
|
checkParentPathsSync,
|
|
3938
|
-
|
|
3914
|
+
// Misc
|
|
3915
|
+
isSrcSubdir,
|
|
3916
|
+
areIdentical
|
|
3917
|
+
};
|
|
3918
|
+
}
|
|
3919
|
+
});
|
|
3920
|
+
|
|
3921
|
+
// ../../../node_modules/fs-extra/lib/util/async.js
|
|
3922
|
+
var require_async = __commonJS({
|
|
3923
|
+
"../../../node_modules/fs-extra/lib/util/async.js"(exports2, module2) {
|
|
3924
|
+
"use strict";
|
|
3925
|
+
async function asyncIteratorConcurrentProcess(iterator, fn) {
|
|
3926
|
+
const promises = [];
|
|
3927
|
+
for await (const item of iterator) {
|
|
3928
|
+
promises.push(
|
|
3929
|
+
fn(item).then(
|
|
3930
|
+
() => null,
|
|
3931
|
+
(err) => err ?? new Error("unknown error")
|
|
3932
|
+
)
|
|
3933
|
+
);
|
|
3934
|
+
}
|
|
3935
|
+
await Promise.all(
|
|
3936
|
+
promises.map(
|
|
3937
|
+
(promise) => promise.then((possibleErr) => {
|
|
3938
|
+
if (possibleErr !== null) throw possibleErr;
|
|
3939
|
+
})
|
|
3940
|
+
)
|
|
3941
|
+
);
|
|
3942
|
+
}
|
|
3943
|
+
__name(asyncIteratorConcurrentProcess, "asyncIteratorConcurrentProcess");
|
|
3944
|
+
module2.exports = {
|
|
3945
|
+
asyncIteratorConcurrentProcess
|
|
3939
3946
|
};
|
|
3940
3947
|
}
|
|
3941
3948
|
});
|
|
3942
3949
|
|
|
3943
|
-
// node_modules/fs-extra/lib/copy
|
|
3950
|
+
// ../../../node_modules/fs-extra/lib/copy/copy.js
|
|
3951
|
+
var require_copy = __commonJS({
|
|
3952
|
+
"../../../node_modules/fs-extra/lib/copy/copy.js"(exports2, module2) {
|
|
3953
|
+
"use strict";
|
|
3954
|
+
var fs3 = require_fs();
|
|
3955
|
+
var path3 = require("path");
|
|
3956
|
+
var { mkdirs } = require_mkdirs();
|
|
3957
|
+
var { pathExists } = require_path_exists();
|
|
3958
|
+
var { utimesMillis } = require_utimes();
|
|
3959
|
+
var stat2 = require_stat();
|
|
3960
|
+
var { asyncIteratorConcurrentProcess } = require_async();
|
|
3961
|
+
async function copy(src, dest, opts = {}) {
|
|
3962
|
+
if (typeof opts === "function") {
|
|
3963
|
+
opts = { filter: opts };
|
|
3964
|
+
}
|
|
3965
|
+
opts.clobber = "clobber" in opts ? !!opts.clobber : true;
|
|
3966
|
+
opts.overwrite = "overwrite" in opts ? !!opts.overwrite : opts.clobber;
|
|
3967
|
+
if (opts.preserveTimestamps && process.arch === "ia32") {
|
|
3968
|
+
process.emitWarning(
|
|
3969
|
+
"Using the preserveTimestamps option in 32-bit node is not recommended;\n\n see https://github.com/jprichardson/node-fs-extra/issues/269",
|
|
3970
|
+
"Warning",
|
|
3971
|
+
"fs-extra-WARN0001"
|
|
3972
|
+
);
|
|
3973
|
+
}
|
|
3974
|
+
const { srcStat, destStat } = await stat2.checkPaths(src, dest, "copy", opts);
|
|
3975
|
+
await stat2.checkParentPaths(src, srcStat, dest, "copy");
|
|
3976
|
+
const include = await runFilter(src, dest, opts);
|
|
3977
|
+
if (!include) return;
|
|
3978
|
+
const destParent = path3.dirname(dest);
|
|
3979
|
+
const dirExists = await pathExists(destParent);
|
|
3980
|
+
if (!dirExists) {
|
|
3981
|
+
await mkdirs(destParent);
|
|
3982
|
+
}
|
|
3983
|
+
await getStatsAndPerformCopy(destStat, src, dest, opts);
|
|
3984
|
+
}
|
|
3985
|
+
__name(copy, "copy");
|
|
3986
|
+
async function runFilter(src, dest, opts) {
|
|
3987
|
+
if (!opts.filter) return true;
|
|
3988
|
+
return opts.filter(src, dest);
|
|
3989
|
+
}
|
|
3990
|
+
__name(runFilter, "runFilter");
|
|
3991
|
+
async function getStatsAndPerformCopy(destStat, src, dest, opts) {
|
|
3992
|
+
const statFn = opts.dereference ? fs3.stat : fs3.lstat;
|
|
3993
|
+
const srcStat = await statFn(src);
|
|
3994
|
+
if (srcStat.isDirectory()) return onDir(srcStat, destStat, src, dest, opts);
|
|
3995
|
+
if (srcStat.isFile() || srcStat.isCharacterDevice() || srcStat.isBlockDevice()) return onFile(srcStat, destStat, src, dest, opts);
|
|
3996
|
+
if (srcStat.isSymbolicLink()) return onLink(destStat, src, dest, opts);
|
|
3997
|
+
if (srcStat.isSocket()) throw new Error(`Cannot copy a socket file: ${src}`);
|
|
3998
|
+
if (srcStat.isFIFO()) throw new Error(`Cannot copy a FIFO pipe: ${src}`);
|
|
3999
|
+
throw new Error(`Unknown file: ${src}`);
|
|
4000
|
+
}
|
|
4001
|
+
__name(getStatsAndPerformCopy, "getStatsAndPerformCopy");
|
|
4002
|
+
async function onFile(srcStat, destStat, src, dest, opts) {
|
|
4003
|
+
if (!destStat) return copyFile(srcStat, src, dest, opts);
|
|
4004
|
+
if (opts.overwrite) {
|
|
4005
|
+
await fs3.unlink(dest);
|
|
4006
|
+
return copyFile(srcStat, src, dest, opts);
|
|
4007
|
+
}
|
|
4008
|
+
if (opts.errorOnExist) {
|
|
4009
|
+
throw new Error(`'${dest}' already exists`);
|
|
4010
|
+
}
|
|
4011
|
+
}
|
|
4012
|
+
__name(onFile, "onFile");
|
|
4013
|
+
async function copyFile(srcStat, src, dest, opts) {
|
|
4014
|
+
await fs3.copyFile(src, dest);
|
|
4015
|
+
if (opts.preserveTimestamps) {
|
|
4016
|
+
if (fileIsNotWritable(srcStat.mode)) {
|
|
4017
|
+
await makeFileWritable(dest, srcStat.mode);
|
|
4018
|
+
}
|
|
4019
|
+
const updatedSrcStat = await fs3.stat(src);
|
|
4020
|
+
await utimesMillis(dest, updatedSrcStat.atime, updatedSrcStat.mtime);
|
|
4021
|
+
}
|
|
4022
|
+
return fs3.chmod(dest, srcStat.mode);
|
|
4023
|
+
}
|
|
4024
|
+
__name(copyFile, "copyFile");
|
|
4025
|
+
function fileIsNotWritable(srcMode) {
|
|
4026
|
+
return (srcMode & 128) === 0;
|
|
4027
|
+
}
|
|
4028
|
+
__name(fileIsNotWritable, "fileIsNotWritable");
|
|
4029
|
+
function makeFileWritable(dest, srcMode) {
|
|
4030
|
+
return fs3.chmod(dest, srcMode | 128);
|
|
4031
|
+
}
|
|
4032
|
+
__name(makeFileWritable, "makeFileWritable");
|
|
4033
|
+
async function onDir(srcStat, destStat, src, dest, opts) {
|
|
4034
|
+
if (!destStat) {
|
|
4035
|
+
await fs3.mkdir(dest);
|
|
4036
|
+
}
|
|
4037
|
+
await asyncIteratorConcurrentProcess(await fs3.opendir(src), async (item) => {
|
|
4038
|
+
const srcItem = path3.join(src, item.name);
|
|
4039
|
+
const destItem = path3.join(dest, item.name);
|
|
4040
|
+
const include = await runFilter(srcItem, destItem, opts);
|
|
4041
|
+
if (include) {
|
|
4042
|
+
const { destStat: destStat2 } = await stat2.checkPaths(srcItem, destItem, "copy", opts);
|
|
4043
|
+
await getStatsAndPerformCopy(destStat2, srcItem, destItem, opts);
|
|
4044
|
+
}
|
|
4045
|
+
});
|
|
4046
|
+
if (!destStat) {
|
|
4047
|
+
await fs3.chmod(dest, srcStat.mode);
|
|
4048
|
+
}
|
|
4049
|
+
}
|
|
4050
|
+
__name(onDir, "onDir");
|
|
4051
|
+
async function onLink(destStat, src, dest, opts) {
|
|
4052
|
+
let resolvedSrc = await fs3.readlink(src);
|
|
4053
|
+
if (opts.dereference) {
|
|
4054
|
+
resolvedSrc = path3.resolve(process.cwd(), resolvedSrc);
|
|
4055
|
+
}
|
|
4056
|
+
if (!destStat) {
|
|
4057
|
+
return fs3.symlink(resolvedSrc, dest);
|
|
4058
|
+
}
|
|
4059
|
+
let resolvedDest = null;
|
|
4060
|
+
try {
|
|
4061
|
+
resolvedDest = await fs3.readlink(dest);
|
|
4062
|
+
} catch (e) {
|
|
4063
|
+
if (e.code === "EINVAL" || e.code === "UNKNOWN") return fs3.symlink(resolvedSrc, dest);
|
|
4064
|
+
throw e;
|
|
4065
|
+
}
|
|
4066
|
+
if (opts.dereference) {
|
|
4067
|
+
resolvedDest = path3.resolve(process.cwd(), resolvedDest);
|
|
4068
|
+
}
|
|
4069
|
+
if (resolvedSrc !== resolvedDest) {
|
|
4070
|
+
if (stat2.isSrcSubdir(resolvedSrc, resolvedDest)) {
|
|
4071
|
+
throw new Error(`Cannot copy '${resolvedSrc}' to a subdirectory of itself, '${resolvedDest}'.`);
|
|
4072
|
+
}
|
|
4073
|
+
if (stat2.isSrcSubdir(resolvedDest, resolvedSrc)) {
|
|
4074
|
+
throw new Error(`Cannot overwrite '${resolvedDest}' with '${resolvedSrc}'.`);
|
|
4075
|
+
}
|
|
4076
|
+
}
|
|
4077
|
+
await fs3.unlink(dest);
|
|
4078
|
+
return fs3.symlink(resolvedSrc, dest);
|
|
4079
|
+
}
|
|
4080
|
+
__name(onLink, "onLink");
|
|
4081
|
+
module2.exports = copy;
|
|
4082
|
+
}
|
|
4083
|
+
});
|
|
4084
|
+
|
|
4085
|
+
// ../../../node_modules/fs-extra/lib/copy/copy-sync.js
|
|
3944
4086
|
var require_copy_sync = __commonJS({
|
|
3945
|
-
"node_modules/fs-extra/lib/copy
|
|
4087
|
+
"../../../node_modules/fs-extra/lib/copy/copy-sync.js"(exports2, module2) {
|
|
3946
4088
|
"use strict";
|
|
3947
4089
|
var fs3 = require_graceful_fs();
|
|
3948
4090
|
var path3 = require("path");
|
|
@@ -3957,33 +4099,29 @@ var require_copy_sync = __commonJS({
|
|
|
3957
4099
|
opts.clobber = "clobber" in opts ? !!opts.clobber : true;
|
|
3958
4100
|
opts.overwrite = "overwrite" in opts ? !!opts.overwrite : opts.clobber;
|
|
3959
4101
|
if (opts.preserveTimestamps && process.arch === "ia32") {
|
|
3960
|
-
|
|
3961
|
-
|
|
3962
|
-
|
|
4102
|
+
process.emitWarning(
|
|
4103
|
+
"Using the preserveTimestamps option in 32-bit node is not recommended;\n\n see https://github.com/jprichardson/node-fs-extra/issues/269",
|
|
4104
|
+
"Warning",
|
|
4105
|
+
"fs-extra-WARN0002"
|
|
4106
|
+
);
|
|
3963
4107
|
}
|
|
3964
|
-
const { srcStat, destStat } = stat2.checkPathsSync(src, dest, "copy");
|
|
4108
|
+
const { srcStat, destStat } = stat2.checkPathsSync(src, dest, "copy", opts);
|
|
3965
4109
|
stat2.checkParentPathsSync(src, srcStat, dest, "copy");
|
|
3966
|
-
return handleFilterAndCopy(destStat, src, dest, opts);
|
|
3967
|
-
}
|
|
3968
|
-
__name(copySync, "copySync");
|
|
3969
|
-
function handleFilterAndCopy(destStat, src, dest, opts) {
|
|
3970
4110
|
if (opts.filter && !opts.filter(src, dest)) return;
|
|
3971
4111
|
const destParent = path3.dirname(dest);
|
|
3972
4112
|
if (!fs3.existsSync(destParent)) mkdirsSync(destParent);
|
|
3973
|
-
return startCopy(destStat, src, dest, opts);
|
|
3974
|
-
}
|
|
3975
|
-
__name(handleFilterAndCopy, "handleFilterAndCopy");
|
|
3976
|
-
function startCopy(destStat, src, dest, opts) {
|
|
3977
|
-
if (opts.filter && !opts.filter(src, dest)) return;
|
|
3978
4113
|
return getStats(destStat, src, dest, opts);
|
|
3979
4114
|
}
|
|
3980
|
-
__name(
|
|
4115
|
+
__name(copySync, "copySync");
|
|
3981
4116
|
function getStats(destStat, src, dest, opts) {
|
|
3982
4117
|
const statSync = opts.dereference ? fs3.statSync : fs3.lstatSync;
|
|
3983
4118
|
const srcStat = statSync(src);
|
|
3984
4119
|
if (srcStat.isDirectory()) return onDir(srcStat, destStat, src, dest, opts);
|
|
3985
4120
|
else if (srcStat.isFile() || srcStat.isCharacterDevice() || srcStat.isBlockDevice()) return onFile(srcStat, destStat, src, dest, opts);
|
|
3986
4121
|
else if (srcStat.isSymbolicLink()) return onLink(destStat, src, dest, opts);
|
|
4122
|
+
else if (srcStat.isSocket()) throw new Error(`Cannot copy a socket file: ${src}`);
|
|
4123
|
+
else if (srcStat.isFIFO()) throw new Error(`Cannot copy a FIFO pipe: ${src}`);
|
|
4124
|
+
throw new Error(`Unknown file: ${src}`);
|
|
3987
4125
|
}
|
|
3988
4126
|
__name(getStats, "getStats");
|
|
3989
4127
|
function onFile(srcStat, destStat, src, dest, opts) {
|
|
@@ -4030,9 +4168,6 @@ var require_copy_sync = __commonJS({
|
|
|
4030
4168
|
__name(setDestTimestamps, "setDestTimestamps");
|
|
4031
4169
|
function onDir(srcStat, destStat, src, dest, opts) {
|
|
4032
4170
|
if (!destStat) return mkDirAndCopy(srcStat.mode, src, dest, opts);
|
|
4033
|
-
if (destStat && !destStat.isDirectory()) {
|
|
4034
|
-
throw new Error(`Cannot overwrite non-directory '${dest}' with directory '${src}'.`);
|
|
4035
|
-
}
|
|
4036
4171
|
return copyDir(src, dest, opts);
|
|
4037
4172
|
}
|
|
4038
4173
|
__name(onDir, "onDir");
|
|
@@ -4043,14 +4178,23 @@ var require_copy_sync = __commonJS({
|
|
|
4043
4178
|
}
|
|
4044
4179
|
__name(mkDirAndCopy, "mkDirAndCopy");
|
|
4045
4180
|
function copyDir(src, dest, opts) {
|
|
4046
|
-
fs3.
|
|
4181
|
+
const dir = fs3.opendirSync(src);
|
|
4182
|
+
try {
|
|
4183
|
+
let dirent;
|
|
4184
|
+
while ((dirent = dir.readSync()) !== null) {
|
|
4185
|
+
copyDirItem(dirent.name, src, dest, opts);
|
|
4186
|
+
}
|
|
4187
|
+
} finally {
|
|
4188
|
+
dir.closeSync();
|
|
4189
|
+
}
|
|
4047
4190
|
}
|
|
4048
4191
|
__name(copyDir, "copyDir");
|
|
4049
4192
|
function copyDirItem(item, src, dest, opts) {
|
|
4050
4193
|
const srcItem = path3.join(src, item);
|
|
4051
4194
|
const destItem = path3.join(dest, item);
|
|
4052
|
-
|
|
4053
|
-
|
|
4195
|
+
if (opts.filter && !opts.filter(srcItem, destItem)) return;
|
|
4196
|
+
const { destStat } = stat2.checkPathsSync(srcItem, destItem, "copy", opts);
|
|
4197
|
+
return getStats(destStat, srcItem, destItem, opts);
|
|
4054
4198
|
}
|
|
4055
4199
|
__name(copyDirItem, "copyDirItem");
|
|
4056
4200
|
function onLink(destStat, src, dest, opts) {
|
|
@@ -4071,563 +4215,77 @@ var require_copy_sync = __commonJS({
|
|
|
4071
4215
|
if (opts.dereference) {
|
|
4072
4216
|
resolvedDest = path3.resolve(process.cwd(), resolvedDest);
|
|
4073
4217
|
}
|
|
4074
|
-
if (
|
|
4075
|
-
|
|
4076
|
-
|
|
4077
|
-
if (fs3.statSync(dest).isDirectory() && stat2.isSrcSubdir(resolvedDest, resolvedSrc)) {
|
|
4078
|
-
throw new Error(`Cannot overwrite '${resolvedDest}' with '${resolvedSrc}'.`);
|
|
4079
|
-
}
|
|
4080
|
-
return copyLink(resolvedSrc, dest);
|
|
4081
|
-
}
|
|
4082
|
-
}
|
|
4083
|
-
__name(onLink, "onLink");
|
|
4084
|
-
function copyLink(resolvedSrc, dest) {
|
|
4085
|
-
fs3.unlinkSync(dest);
|
|
4086
|
-
return fs3.symlinkSync(resolvedSrc, dest);
|
|
4087
|
-
}
|
|
4088
|
-
__name(copyLink, "copyLink");
|
|
4089
|
-
module2.exports = copySync;
|
|
4090
|
-
}
|
|
4091
|
-
});
|
|
4092
|
-
|
|
4093
|
-
// node_modules/fs-extra/lib/copy-sync/index.js
|
|
4094
|
-
var require_copy_sync2 = __commonJS({
|
|
4095
|
-
"node_modules/fs-extra/lib/copy-sync/index.js"(exports2, module2) {
|
|
4096
|
-
"use strict";
|
|
4097
|
-
module2.exports = {
|
|
4098
|
-
copySync: require_copy_sync()
|
|
4099
|
-
};
|
|
4100
|
-
}
|
|
4101
|
-
});
|
|
4102
|
-
|
|
4103
|
-
// node_modules/fs-extra/lib/path-exists/index.js
|
|
4104
|
-
var require_path_exists = __commonJS({
|
|
4105
|
-
"node_modules/fs-extra/lib/path-exists/index.js"(exports2, module2) {
|
|
4106
|
-
"use strict";
|
|
4107
|
-
var u = require_universalify().fromPromise;
|
|
4108
|
-
var fs3 = require_fs();
|
|
4109
|
-
function pathExists(path3) {
|
|
4110
|
-
return fs3.access(path3).then(() => true).catch(() => false);
|
|
4111
|
-
}
|
|
4112
|
-
__name(pathExists, "pathExists");
|
|
4113
|
-
module2.exports = {
|
|
4114
|
-
pathExists: u(pathExists),
|
|
4115
|
-
pathExistsSync: fs3.existsSync
|
|
4116
|
-
};
|
|
4117
|
-
}
|
|
4118
|
-
});
|
|
4119
|
-
|
|
4120
|
-
// node_modules/fs-extra/lib/copy/copy.js
|
|
4121
|
-
var require_copy = __commonJS({
|
|
4122
|
-
"node_modules/fs-extra/lib/copy/copy.js"(exports2, module2) {
|
|
4123
|
-
"use strict";
|
|
4124
|
-
var fs3 = require_graceful_fs();
|
|
4125
|
-
var path3 = require("path");
|
|
4126
|
-
var mkdirs = require_mkdirs().mkdirs;
|
|
4127
|
-
var pathExists = require_path_exists().pathExists;
|
|
4128
|
-
var utimesMillis = require_utimes().utimesMillis;
|
|
4129
|
-
var stat2 = require_stat();
|
|
4130
|
-
function copy(src, dest, opts, cb) {
|
|
4131
|
-
if (typeof opts === "function" && !cb) {
|
|
4132
|
-
cb = opts;
|
|
4133
|
-
opts = {};
|
|
4134
|
-
} else if (typeof opts === "function") {
|
|
4135
|
-
opts = { filter: opts };
|
|
4136
|
-
}
|
|
4137
|
-
cb = cb || function() {
|
|
4138
|
-
};
|
|
4139
|
-
opts = opts || {};
|
|
4140
|
-
opts.clobber = "clobber" in opts ? !!opts.clobber : true;
|
|
4141
|
-
opts.overwrite = "overwrite" in opts ? !!opts.overwrite : opts.clobber;
|
|
4142
|
-
if (opts.preserveTimestamps && process.arch === "ia32") {
|
|
4143
|
-
console.warn(`fs-extra: Using the preserveTimestamps option in 32-bit node is not recommended;
|
|
4144
|
-
|
|
4145
|
-
see https://github.com/jprichardson/node-fs-extra/issues/269`);
|
|
4146
|
-
}
|
|
4147
|
-
stat2.checkPaths(src, dest, "copy", (err, stats) => {
|
|
4148
|
-
if (err) return cb(err);
|
|
4149
|
-
const { srcStat, destStat } = stats;
|
|
4150
|
-
stat2.checkParentPaths(src, srcStat, dest, "copy", (err2) => {
|
|
4151
|
-
if (err2) return cb(err2);
|
|
4152
|
-
if (opts.filter) return handleFilter(checkParentDir, destStat, src, dest, opts, cb);
|
|
4153
|
-
return checkParentDir(destStat, src, dest, opts, cb);
|
|
4154
|
-
});
|
|
4155
|
-
});
|
|
4156
|
-
}
|
|
4157
|
-
__name(copy, "copy");
|
|
4158
|
-
function checkParentDir(destStat, src, dest, opts, cb) {
|
|
4159
|
-
const destParent = path3.dirname(dest);
|
|
4160
|
-
pathExists(destParent, (err, dirExists) => {
|
|
4161
|
-
if (err) return cb(err);
|
|
4162
|
-
if (dirExists) return startCopy(destStat, src, dest, opts, cb);
|
|
4163
|
-
mkdirs(destParent, (err2) => {
|
|
4164
|
-
if (err2) return cb(err2);
|
|
4165
|
-
return startCopy(destStat, src, dest, opts, cb);
|
|
4166
|
-
});
|
|
4167
|
-
});
|
|
4168
|
-
}
|
|
4169
|
-
__name(checkParentDir, "checkParentDir");
|
|
4170
|
-
function handleFilter(onInclude, destStat, src, dest, opts, cb) {
|
|
4171
|
-
Promise.resolve(opts.filter(src, dest)).then((include) => {
|
|
4172
|
-
if (include) return onInclude(destStat, src, dest, opts, cb);
|
|
4173
|
-
return cb();
|
|
4174
|
-
}, (error2) => cb(error2));
|
|
4175
|
-
}
|
|
4176
|
-
__name(handleFilter, "handleFilter");
|
|
4177
|
-
function startCopy(destStat, src, dest, opts, cb) {
|
|
4178
|
-
if (opts.filter) return handleFilter(getStats, destStat, src, dest, opts, cb);
|
|
4179
|
-
return getStats(destStat, src, dest, opts, cb);
|
|
4180
|
-
}
|
|
4181
|
-
__name(startCopy, "startCopy");
|
|
4182
|
-
function getStats(destStat, src, dest, opts, cb) {
|
|
4183
|
-
const stat3 = opts.dereference ? fs3.stat : fs3.lstat;
|
|
4184
|
-
stat3(src, (err, srcStat) => {
|
|
4185
|
-
if (err) return cb(err);
|
|
4186
|
-
if (srcStat.isDirectory()) return onDir(srcStat, destStat, src, dest, opts, cb);
|
|
4187
|
-
else if (srcStat.isFile() || srcStat.isCharacterDevice() || srcStat.isBlockDevice()) return onFile(srcStat, destStat, src, dest, opts, cb);
|
|
4188
|
-
else if (srcStat.isSymbolicLink()) return onLink(destStat, src, dest, opts, cb);
|
|
4189
|
-
});
|
|
4190
|
-
}
|
|
4191
|
-
__name(getStats, "getStats");
|
|
4192
|
-
function onFile(srcStat, destStat, src, dest, opts, cb) {
|
|
4193
|
-
if (!destStat) return copyFile(srcStat, src, dest, opts, cb);
|
|
4194
|
-
return mayCopyFile(srcStat, src, dest, opts, cb);
|
|
4195
|
-
}
|
|
4196
|
-
__name(onFile, "onFile");
|
|
4197
|
-
function mayCopyFile(srcStat, src, dest, opts, cb) {
|
|
4198
|
-
if (opts.overwrite) {
|
|
4199
|
-
fs3.unlink(dest, (err) => {
|
|
4200
|
-
if (err) return cb(err);
|
|
4201
|
-
return copyFile(srcStat, src, dest, opts, cb);
|
|
4202
|
-
});
|
|
4203
|
-
} else if (opts.errorOnExist) {
|
|
4204
|
-
return cb(new Error(`'${dest}' already exists`));
|
|
4205
|
-
} else return cb();
|
|
4206
|
-
}
|
|
4207
|
-
__name(mayCopyFile, "mayCopyFile");
|
|
4208
|
-
function copyFile(srcStat, src, dest, opts, cb) {
|
|
4209
|
-
fs3.copyFile(src, dest, (err) => {
|
|
4210
|
-
if (err) return cb(err);
|
|
4211
|
-
if (opts.preserveTimestamps) return handleTimestampsAndMode(srcStat.mode, src, dest, cb);
|
|
4212
|
-
return setDestMode(dest, srcStat.mode, cb);
|
|
4213
|
-
});
|
|
4214
|
-
}
|
|
4215
|
-
__name(copyFile, "copyFile");
|
|
4216
|
-
function handleTimestampsAndMode(srcMode, src, dest, cb) {
|
|
4217
|
-
if (fileIsNotWritable(srcMode)) {
|
|
4218
|
-
return makeFileWritable(dest, srcMode, (err) => {
|
|
4219
|
-
if (err) return cb(err);
|
|
4220
|
-
return setDestTimestampsAndMode(srcMode, src, dest, cb);
|
|
4221
|
-
});
|
|
4222
|
-
}
|
|
4223
|
-
return setDestTimestampsAndMode(srcMode, src, dest, cb);
|
|
4224
|
-
}
|
|
4225
|
-
__name(handleTimestampsAndMode, "handleTimestampsAndMode");
|
|
4226
|
-
function fileIsNotWritable(srcMode) {
|
|
4227
|
-
return (srcMode & 128) === 0;
|
|
4228
|
-
}
|
|
4229
|
-
__name(fileIsNotWritable, "fileIsNotWritable");
|
|
4230
|
-
function makeFileWritable(dest, srcMode, cb) {
|
|
4231
|
-
return setDestMode(dest, srcMode | 128, cb);
|
|
4232
|
-
}
|
|
4233
|
-
__name(makeFileWritable, "makeFileWritable");
|
|
4234
|
-
function setDestTimestampsAndMode(srcMode, src, dest, cb) {
|
|
4235
|
-
setDestTimestamps(src, dest, (err) => {
|
|
4236
|
-
if (err) return cb(err);
|
|
4237
|
-
return setDestMode(dest, srcMode, cb);
|
|
4238
|
-
});
|
|
4239
|
-
}
|
|
4240
|
-
__name(setDestTimestampsAndMode, "setDestTimestampsAndMode");
|
|
4241
|
-
function setDestMode(dest, srcMode, cb) {
|
|
4242
|
-
return fs3.chmod(dest, srcMode, cb);
|
|
4243
|
-
}
|
|
4244
|
-
__name(setDestMode, "setDestMode");
|
|
4245
|
-
function setDestTimestamps(src, dest, cb) {
|
|
4246
|
-
fs3.stat(src, (err, updatedSrcStat) => {
|
|
4247
|
-
if (err) return cb(err);
|
|
4248
|
-
return utimesMillis(dest, updatedSrcStat.atime, updatedSrcStat.mtime, cb);
|
|
4249
|
-
});
|
|
4250
|
-
}
|
|
4251
|
-
__name(setDestTimestamps, "setDestTimestamps");
|
|
4252
|
-
function onDir(srcStat, destStat, src, dest, opts, cb) {
|
|
4253
|
-
if (!destStat) return mkDirAndCopy(srcStat.mode, src, dest, opts, cb);
|
|
4254
|
-
if (destStat && !destStat.isDirectory()) {
|
|
4255
|
-
return cb(new Error(`Cannot overwrite non-directory '${dest}' with directory '${src}'.`));
|
|
4256
|
-
}
|
|
4257
|
-
return copyDir(src, dest, opts, cb);
|
|
4258
|
-
}
|
|
4259
|
-
__name(onDir, "onDir");
|
|
4260
|
-
function mkDirAndCopy(srcMode, src, dest, opts, cb) {
|
|
4261
|
-
fs3.mkdir(dest, (err) => {
|
|
4262
|
-
if (err) return cb(err);
|
|
4263
|
-
copyDir(src, dest, opts, (err2) => {
|
|
4264
|
-
if (err2) return cb(err2);
|
|
4265
|
-
return setDestMode(dest, srcMode, cb);
|
|
4266
|
-
});
|
|
4267
|
-
});
|
|
4268
|
-
}
|
|
4269
|
-
__name(mkDirAndCopy, "mkDirAndCopy");
|
|
4270
|
-
function copyDir(src, dest, opts, cb) {
|
|
4271
|
-
fs3.readdir(src, (err, items) => {
|
|
4272
|
-
if (err) return cb(err);
|
|
4273
|
-
return copyDirItems(items, src, dest, opts, cb);
|
|
4274
|
-
});
|
|
4275
|
-
}
|
|
4276
|
-
__name(copyDir, "copyDir");
|
|
4277
|
-
function copyDirItems(items, src, dest, opts, cb) {
|
|
4278
|
-
const item = items.pop();
|
|
4279
|
-
if (!item) return cb();
|
|
4280
|
-
return copyDirItem(items, item, src, dest, opts, cb);
|
|
4281
|
-
}
|
|
4282
|
-
__name(copyDirItems, "copyDirItems");
|
|
4283
|
-
function copyDirItem(items, item, src, dest, opts, cb) {
|
|
4284
|
-
const srcItem = path3.join(src, item);
|
|
4285
|
-
const destItem = path3.join(dest, item);
|
|
4286
|
-
stat2.checkPaths(srcItem, destItem, "copy", (err, stats) => {
|
|
4287
|
-
if (err) return cb(err);
|
|
4288
|
-
const { destStat } = stats;
|
|
4289
|
-
startCopy(destStat, srcItem, destItem, opts, (err2) => {
|
|
4290
|
-
if (err2) return cb(err2);
|
|
4291
|
-
return copyDirItems(items, src, dest, opts, cb);
|
|
4292
|
-
});
|
|
4293
|
-
});
|
|
4294
|
-
}
|
|
4295
|
-
__name(copyDirItem, "copyDirItem");
|
|
4296
|
-
function onLink(destStat, src, dest, opts, cb) {
|
|
4297
|
-
fs3.readlink(src, (err, resolvedSrc) => {
|
|
4298
|
-
if (err) return cb(err);
|
|
4299
|
-
if (opts.dereference) {
|
|
4300
|
-
resolvedSrc = path3.resolve(process.cwd(), resolvedSrc);
|
|
4301
|
-
}
|
|
4302
|
-
if (!destStat) {
|
|
4303
|
-
return fs3.symlink(resolvedSrc, dest, cb);
|
|
4304
|
-
} else {
|
|
4305
|
-
fs3.readlink(dest, (err2, resolvedDest) => {
|
|
4306
|
-
if (err2) {
|
|
4307
|
-
if (err2.code === "EINVAL" || err2.code === "UNKNOWN") return fs3.symlink(resolvedSrc, dest, cb);
|
|
4308
|
-
return cb(err2);
|
|
4309
|
-
}
|
|
4310
|
-
if (opts.dereference) {
|
|
4311
|
-
resolvedDest = path3.resolve(process.cwd(), resolvedDest);
|
|
4312
|
-
}
|
|
4313
|
-
if (stat2.isSrcSubdir(resolvedSrc, resolvedDest)) {
|
|
4314
|
-
return cb(new Error(`Cannot copy '${resolvedSrc}' to a subdirectory of itself, '${resolvedDest}'.`));
|
|
4315
|
-
}
|
|
4316
|
-
if (destStat.isDirectory() && stat2.isSrcSubdir(resolvedDest, resolvedSrc)) {
|
|
4317
|
-
return cb(new Error(`Cannot overwrite '${resolvedDest}' with '${resolvedSrc}'.`));
|
|
4318
|
-
}
|
|
4319
|
-
return copyLink(resolvedSrc, dest, cb);
|
|
4320
|
-
});
|
|
4321
|
-
}
|
|
4322
|
-
});
|
|
4323
|
-
}
|
|
4324
|
-
__name(onLink, "onLink");
|
|
4325
|
-
function copyLink(resolvedSrc, dest, cb) {
|
|
4326
|
-
fs3.unlink(dest, (err) => {
|
|
4327
|
-
if (err) return cb(err);
|
|
4328
|
-
return fs3.symlink(resolvedSrc, dest, cb);
|
|
4329
|
-
});
|
|
4330
|
-
}
|
|
4331
|
-
__name(copyLink, "copyLink");
|
|
4332
|
-
module2.exports = copy;
|
|
4333
|
-
}
|
|
4334
|
-
});
|
|
4335
|
-
|
|
4336
|
-
// node_modules/fs-extra/lib/copy/index.js
|
|
4337
|
-
var require_copy2 = __commonJS({
|
|
4338
|
-
"node_modules/fs-extra/lib/copy/index.js"(exports2, module2) {
|
|
4339
|
-
"use strict";
|
|
4340
|
-
var u = require_universalify().fromCallback;
|
|
4341
|
-
module2.exports = {
|
|
4342
|
-
copy: u(require_copy())
|
|
4343
|
-
};
|
|
4344
|
-
}
|
|
4345
|
-
});
|
|
4346
|
-
|
|
4347
|
-
// node_modules/fs-extra/lib/remove/rimraf.js
|
|
4348
|
-
var require_rimraf = __commonJS({
|
|
4349
|
-
"node_modules/fs-extra/lib/remove/rimraf.js"(exports2, module2) {
|
|
4350
|
-
"use strict";
|
|
4351
|
-
var fs3 = require_graceful_fs();
|
|
4352
|
-
var path3 = require("path");
|
|
4353
|
-
var assert = require("assert");
|
|
4354
|
-
var isWindows = process.platform === "win32";
|
|
4355
|
-
function defaults(options) {
|
|
4356
|
-
const methods = [
|
|
4357
|
-
"unlink",
|
|
4358
|
-
"chmod",
|
|
4359
|
-
"stat",
|
|
4360
|
-
"lstat",
|
|
4361
|
-
"rmdir",
|
|
4362
|
-
"readdir"
|
|
4363
|
-
];
|
|
4364
|
-
methods.forEach((m) => {
|
|
4365
|
-
options[m] = options[m] || fs3[m];
|
|
4366
|
-
m = m + "Sync";
|
|
4367
|
-
options[m] = options[m] || fs3[m];
|
|
4368
|
-
});
|
|
4369
|
-
options.maxBusyTries = options.maxBusyTries || 3;
|
|
4370
|
-
}
|
|
4371
|
-
__name(defaults, "defaults");
|
|
4372
|
-
function rimraf(p, options, cb) {
|
|
4373
|
-
let busyTries = 0;
|
|
4374
|
-
if (typeof options === "function") {
|
|
4375
|
-
cb = options;
|
|
4376
|
-
options = {};
|
|
4377
|
-
}
|
|
4378
|
-
assert(p, "rimraf: missing path");
|
|
4379
|
-
assert.strictEqual(typeof p, "string", "rimraf: path should be a string");
|
|
4380
|
-
assert.strictEqual(typeof cb, "function", "rimraf: callback function required");
|
|
4381
|
-
assert(options, "rimraf: invalid options argument provided");
|
|
4382
|
-
assert.strictEqual(typeof options, "object", "rimraf: options should be object");
|
|
4383
|
-
defaults(options);
|
|
4384
|
-
rimraf_(p, options, /* @__PURE__ */ __name(function CB(er) {
|
|
4385
|
-
if (er) {
|
|
4386
|
-
if ((er.code === "EBUSY" || er.code === "ENOTEMPTY" || er.code === "EPERM") && busyTries < options.maxBusyTries) {
|
|
4387
|
-
busyTries++;
|
|
4388
|
-
const time = busyTries * 100;
|
|
4389
|
-
return setTimeout(() => rimraf_(p, options, CB), time);
|
|
4390
|
-
}
|
|
4391
|
-
if (er.code === "ENOENT") er = null;
|
|
4392
|
-
}
|
|
4393
|
-
cb(er);
|
|
4394
|
-
}, "CB"));
|
|
4395
|
-
}
|
|
4396
|
-
__name(rimraf, "rimraf");
|
|
4397
|
-
function rimraf_(p, options, cb) {
|
|
4398
|
-
assert(p);
|
|
4399
|
-
assert(options);
|
|
4400
|
-
assert(typeof cb === "function");
|
|
4401
|
-
options.lstat(p, (er, st) => {
|
|
4402
|
-
if (er && er.code === "ENOENT") {
|
|
4403
|
-
return cb(null);
|
|
4404
|
-
}
|
|
4405
|
-
if (er && er.code === "EPERM" && isWindows) {
|
|
4406
|
-
return fixWinEPERM(p, options, er, cb);
|
|
4407
|
-
}
|
|
4408
|
-
if (st && st.isDirectory()) {
|
|
4409
|
-
return rmdir(p, options, er, cb);
|
|
4410
|
-
}
|
|
4411
|
-
options.unlink(p, (er2) => {
|
|
4412
|
-
if (er2) {
|
|
4413
|
-
if (er2.code === "ENOENT") {
|
|
4414
|
-
return cb(null);
|
|
4415
|
-
}
|
|
4416
|
-
if (er2.code === "EPERM") {
|
|
4417
|
-
return isWindows ? fixWinEPERM(p, options, er2, cb) : rmdir(p, options, er2, cb);
|
|
4418
|
-
}
|
|
4419
|
-
if (er2.code === "EISDIR") {
|
|
4420
|
-
return rmdir(p, options, er2, cb);
|
|
4421
|
-
}
|
|
4218
|
+
if (resolvedSrc !== resolvedDest) {
|
|
4219
|
+
if (stat2.isSrcSubdir(resolvedSrc, resolvedDest)) {
|
|
4220
|
+
throw new Error(`Cannot copy '${resolvedSrc}' to a subdirectory of itself, '${resolvedDest}'.`);
|
|
4422
4221
|
}
|
|
4423
|
-
|
|
4424
|
-
|
|
4425
|
-
});
|
|
4426
|
-
}
|
|
4427
|
-
__name(rimraf_, "rimraf_");
|
|
4428
|
-
function fixWinEPERM(p, options, er, cb) {
|
|
4429
|
-
assert(p);
|
|
4430
|
-
assert(options);
|
|
4431
|
-
assert(typeof cb === "function");
|
|
4432
|
-
options.chmod(p, 438, (er2) => {
|
|
4433
|
-
if (er2) {
|
|
4434
|
-
cb(er2.code === "ENOENT" ? null : er);
|
|
4435
|
-
} else {
|
|
4436
|
-
options.stat(p, (er3, stats) => {
|
|
4437
|
-
if (er3) {
|
|
4438
|
-
cb(er3.code === "ENOENT" ? null : er);
|
|
4439
|
-
} else if (stats.isDirectory()) {
|
|
4440
|
-
rmdir(p, options, er, cb);
|
|
4441
|
-
} else {
|
|
4442
|
-
options.unlink(p, cb);
|
|
4443
|
-
}
|
|
4444
|
-
});
|
|
4445
|
-
}
|
|
4446
|
-
});
|
|
4447
|
-
}
|
|
4448
|
-
__name(fixWinEPERM, "fixWinEPERM");
|
|
4449
|
-
function fixWinEPERMSync(p, options, er) {
|
|
4450
|
-
let stats;
|
|
4451
|
-
assert(p);
|
|
4452
|
-
assert(options);
|
|
4453
|
-
try {
|
|
4454
|
-
options.chmodSync(p, 438);
|
|
4455
|
-
} catch (er2) {
|
|
4456
|
-
if (er2.code === "ENOENT") {
|
|
4457
|
-
return;
|
|
4458
|
-
} else {
|
|
4459
|
-
throw er;
|
|
4460
|
-
}
|
|
4461
|
-
}
|
|
4462
|
-
try {
|
|
4463
|
-
stats = options.statSync(p);
|
|
4464
|
-
} catch (er3) {
|
|
4465
|
-
if (er3.code === "ENOENT") {
|
|
4466
|
-
return;
|
|
4467
|
-
} else {
|
|
4468
|
-
throw er;
|
|
4469
|
-
}
|
|
4470
|
-
}
|
|
4471
|
-
if (stats.isDirectory()) {
|
|
4472
|
-
rmdirSync(p, options, er);
|
|
4473
|
-
} else {
|
|
4474
|
-
options.unlinkSync(p);
|
|
4475
|
-
}
|
|
4476
|
-
}
|
|
4477
|
-
__name(fixWinEPERMSync, "fixWinEPERMSync");
|
|
4478
|
-
function rmdir(p, options, originalEr, cb) {
|
|
4479
|
-
assert(p);
|
|
4480
|
-
assert(options);
|
|
4481
|
-
assert(typeof cb === "function");
|
|
4482
|
-
options.rmdir(p, (er) => {
|
|
4483
|
-
if (er && (er.code === "ENOTEMPTY" || er.code === "EEXIST" || er.code === "EPERM")) {
|
|
4484
|
-
rmkids(p, options, cb);
|
|
4485
|
-
} else if (er && er.code === "ENOTDIR") {
|
|
4486
|
-
cb(originalEr);
|
|
4487
|
-
} else {
|
|
4488
|
-
cb(er);
|
|
4489
|
-
}
|
|
4490
|
-
});
|
|
4491
|
-
}
|
|
4492
|
-
__name(rmdir, "rmdir");
|
|
4493
|
-
function rmkids(p, options, cb) {
|
|
4494
|
-
assert(p);
|
|
4495
|
-
assert(options);
|
|
4496
|
-
assert(typeof cb === "function");
|
|
4497
|
-
options.readdir(p, (er, files) => {
|
|
4498
|
-
if (er) return cb(er);
|
|
4499
|
-
let n = files.length;
|
|
4500
|
-
let errState;
|
|
4501
|
-
if (n === 0) return options.rmdir(p, cb);
|
|
4502
|
-
files.forEach((f) => {
|
|
4503
|
-
rimraf(path3.join(p, f), options, (er2) => {
|
|
4504
|
-
if (errState) {
|
|
4505
|
-
return;
|
|
4506
|
-
}
|
|
4507
|
-
if (er2) return cb(errState = er2);
|
|
4508
|
-
if (--n === 0) {
|
|
4509
|
-
options.rmdir(p, cb);
|
|
4510
|
-
}
|
|
4511
|
-
});
|
|
4512
|
-
});
|
|
4513
|
-
});
|
|
4514
|
-
}
|
|
4515
|
-
__name(rmkids, "rmkids");
|
|
4516
|
-
function rimrafSync(p, options) {
|
|
4517
|
-
let st;
|
|
4518
|
-
options = options || {};
|
|
4519
|
-
defaults(options);
|
|
4520
|
-
assert(p, "rimraf: missing path");
|
|
4521
|
-
assert.strictEqual(typeof p, "string", "rimraf: path should be a string");
|
|
4522
|
-
assert(options, "rimraf: missing options");
|
|
4523
|
-
assert.strictEqual(typeof options, "object", "rimraf: options should be object");
|
|
4524
|
-
try {
|
|
4525
|
-
st = options.lstatSync(p);
|
|
4526
|
-
} catch (er) {
|
|
4527
|
-
if (er.code === "ENOENT") {
|
|
4528
|
-
return;
|
|
4529
|
-
}
|
|
4530
|
-
if (er.code === "EPERM" && isWindows) {
|
|
4531
|
-
fixWinEPERMSync(p, options, er);
|
|
4532
|
-
}
|
|
4533
|
-
}
|
|
4534
|
-
try {
|
|
4535
|
-
if (st && st.isDirectory()) {
|
|
4536
|
-
rmdirSync(p, options, null);
|
|
4537
|
-
} else {
|
|
4538
|
-
options.unlinkSync(p);
|
|
4539
|
-
}
|
|
4540
|
-
} catch (er) {
|
|
4541
|
-
if (er.code === "ENOENT") {
|
|
4542
|
-
return;
|
|
4543
|
-
} else if (er.code === "EPERM") {
|
|
4544
|
-
return isWindows ? fixWinEPERMSync(p, options, er) : rmdirSync(p, options, er);
|
|
4545
|
-
} else if (er.code !== "EISDIR") {
|
|
4546
|
-
throw er;
|
|
4547
|
-
}
|
|
4548
|
-
rmdirSync(p, options, er);
|
|
4549
|
-
}
|
|
4550
|
-
}
|
|
4551
|
-
__name(rimrafSync, "rimrafSync");
|
|
4552
|
-
function rmdirSync(p, options, originalEr) {
|
|
4553
|
-
assert(p);
|
|
4554
|
-
assert(options);
|
|
4555
|
-
try {
|
|
4556
|
-
options.rmdirSync(p);
|
|
4557
|
-
} catch (er) {
|
|
4558
|
-
if (er.code === "ENOTDIR") {
|
|
4559
|
-
throw originalEr;
|
|
4560
|
-
} else if (er.code === "ENOTEMPTY" || er.code === "EEXIST" || er.code === "EPERM") {
|
|
4561
|
-
rmkidsSync(p, options);
|
|
4562
|
-
} else if (er.code !== "ENOENT") {
|
|
4563
|
-
throw er;
|
|
4564
|
-
}
|
|
4565
|
-
}
|
|
4566
|
-
}
|
|
4567
|
-
__name(rmdirSync, "rmdirSync");
|
|
4568
|
-
function rmkidsSync(p, options) {
|
|
4569
|
-
assert(p);
|
|
4570
|
-
assert(options);
|
|
4571
|
-
options.readdirSync(p).forEach((f) => rimrafSync(path3.join(p, f), options));
|
|
4572
|
-
if (isWindows) {
|
|
4573
|
-
const startTime = Date.now();
|
|
4574
|
-
do {
|
|
4575
|
-
try {
|
|
4576
|
-
const ret = options.rmdirSync(p, options);
|
|
4577
|
-
return ret;
|
|
4578
|
-
} catch {
|
|
4222
|
+
if (stat2.isSrcSubdir(resolvedDest, resolvedSrc)) {
|
|
4223
|
+
throw new Error(`Cannot overwrite '${resolvedDest}' with '${resolvedSrc}'.`);
|
|
4579
4224
|
}
|
|
4580
|
-
}
|
|
4581
|
-
|
|
4582
|
-
const ret = options.rmdirSync(p, options);
|
|
4583
|
-
return ret;
|
|
4225
|
+
}
|
|
4226
|
+
return copyLink(resolvedSrc, dest);
|
|
4584
4227
|
}
|
|
4585
4228
|
}
|
|
4586
|
-
__name(
|
|
4587
|
-
|
|
4588
|
-
|
|
4229
|
+
__name(onLink, "onLink");
|
|
4230
|
+
function copyLink(resolvedSrc, dest) {
|
|
4231
|
+
fs3.unlinkSync(dest);
|
|
4232
|
+
return fs3.symlinkSync(resolvedSrc, dest);
|
|
4233
|
+
}
|
|
4234
|
+
__name(copyLink, "copyLink");
|
|
4235
|
+
module2.exports = copySync;
|
|
4236
|
+
}
|
|
4237
|
+
});
|
|
4238
|
+
|
|
4239
|
+
// ../../../node_modules/fs-extra/lib/copy/index.js
|
|
4240
|
+
var require_copy2 = __commonJS({
|
|
4241
|
+
"../../../node_modules/fs-extra/lib/copy/index.js"(exports2, module2) {
|
|
4242
|
+
"use strict";
|
|
4243
|
+
var u = require_universalify().fromPromise;
|
|
4244
|
+
module2.exports = {
|
|
4245
|
+
copy: u(require_copy()),
|
|
4246
|
+
copySync: require_copy_sync()
|
|
4247
|
+
};
|
|
4589
4248
|
}
|
|
4590
4249
|
});
|
|
4591
4250
|
|
|
4592
|
-
// node_modules/fs-extra/lib/remove/index.js
|
|
4251
|
+
// ../../../node_modules/fs-extra/lib/remove/index.js
|
|
4593
4252
|
var require_remove = __commonJS({
|
|
4594
|
-
"node_modules/fs-extra/lib/remove/index.js"(exports2, module2) {
|
|
4253
|
+
"../../../node_modules/fs-extra/lib/remove/index.js"(exports2, module2) {
|
|
4595
4254
|
"use strict";
|
|
4255
|
+
var fs3 = require_graceful_fs();
|
|
4596
4256
|
var u = require_universalify().fromCallback;
|
|
4597
|
-
|
|
4257
|
+
function remove(path3, callback) {
|
|
4258
|
+
fs3.rm(path3, { recursive: true, force: true }, callback);
|
|
4259
|
+
}
|
|
4260
|
+
__name(remove, "remove");
|
|
4261
|
+
function removeSync(path3) {
|
|
4262
|
+
fs3.rmSync(path3, { recursive: true, force: true });
|
|
4263
|
+
}
|
|
4264
|
+
__name(removeSync, "removeSync");
|
|
4598
4265
|
module2.exports = {
|
|
4599
|
-
remove: u(
|
|
4600
|
-
removeSync
|
|
4266
|
+
remove: u(remove),
|
|
4267
|
+
removeSync
|
|
4601
4268
|
};
|
|
4602
4269
|
}
|
|
4603
4270
|
});
|
|
4604
4271
|
|
|
4605
|
-
// node_modules/fs-extra/lib/empty/index.js
|
|
4272
|
+
// ../../../node_modules/fs-extra/lib/empty/index.js
|
|
4606
4273
|
var require_empty = __commonJS({
|
|
4607
|
-
"node_modules/fs-extra/lib/empty/index.js"(exports2, module2) {
|
|
4274
|
+
"../../../node_modules/fs-extra/lib/empty/index.js"(exports2, module2) {
|
|
4608
4275
|
"use strict";
|
|
4609
|
-
var u = require_universalify().
|
|
4610
|
-
var fs3 =
|
|
4276
|
+
var u = require_universalify().fromPromise;
|
|
4277
|
+
var fs3 = require_fs();
|
|
4611
4278
|
var path3 = require("path");
|
|
4612
4279
|
var mkdir = require_mkdirs();
|
|
4613
4280
|
var remove = require_remove();
|
|
4614
|
-
var emptyDir = u(/* @__PURE__ */ __name(function emptyDir2(dir
|
|
4615
|
-
|
|
4616
|
-
|
|
4617
|
-
|
|
4618
|
-
|
|
4619
|
-
|
|
4620
|
-
|
|
4621
|
-
|
|
4622
|
-
const item = items.pop();
|
|
4623
|
-
if (!item) return callback();
|
|
4624
|
-
remove.remove(item, (err2) => {
|
|
4625
|
-
if (err2) return callback(err2);
|
|
4626
|
-
deleteItem();
|
|
4627
|
-
});
|
|
4628
|
-
}
|
|
4629
|
-
__name(deleteItem, "deleteItem");
|
|
4630
|
-
});
|
|
4281
|
+
var emptyDir = u(/* @__PURE__ */ __name(async function emptyDir2(dir) {
|
|
4282
|
+
let items;
|
|
4283
|
+
try {
|
|
4284
|
+
items = await fs3.readdir(dir);
|
|
4285
|
+
} catch {
|
|
4286
|
+
return mkdir.mkdirs(dir);
|
|
4287
|
+
}
|
|
4288
|
+
return Promise.all(items.map((item) => remove.remove(path3.join(dir, item))));
|
|
4631
4289
|
}, "emptyDir"));
|
|
4632
4290
|
function emptyDirSync(dir) {
|
|
4633
4291
|
let items;
|
|
@@ -4651,43 +4309,39 @@ var require_empty = __commonJS({
|
|
|
4651
4309
|
}
|
|
4652
4310
|
});
|
|
4653
4311
|
|
|
4654
|
-
// node_modules/fs-extra/lib/ensure/file.js
|
|
4312
|
+
// ../../../node_modules/fs-extra/lib/ensure/file.js
|
|
4655
4313
|
var require_file = __commonJS({
|
|
4656
|
-
"node_modules/fs-extra/lib/ensure/file.js"(exports2, module2) {
|
|
4314
|
+
"../../../node_modules/fs-extra/lib/ensure/file.js"(exports2, module2) {
|
|
4657
4315
|
"use strict";
|
|
4658
|
-
var u = require_universalify().
|
|
4316
|
+
var u = require_universalify().fromPromise;
|
|
4659
4317
|
var path3 = require("path");
|
|
4660
|
-
var fs3 =
|
|
4318
|
+
var fs3 = require_fs();
|
|
4661
4319
|
var mkdir = require_mkdirs();
|
|
4662
|
-
function createFile(file
|
|
4663
|
-
|
|
4664
|
-
|
|
4665
|
-
|
|
4666
|
-
|
|
4667
|
-
|
|
4320
|
+
async function createFile(file) {
|
|
4321
|
+
let stats;
|
|
4322
|
+
try {
|
|
4323
|
+
stats = await fs3.stat(file);
|
|
4324
|
+
} catch {
|
|
4325
|
+
}
|
|
4326
|
+
if (stats && stats.isFile()) return;
|
|
4327
|
+
const dir = path3.dirname(file);
|
|
4328
|
+
let dirStats = null;
|
|
4329
|
+
try {
|
|
4330
|
+
dirStats = await fs3.stat(dir);
|
|
4331
|
+
} catch (err) {
|
|
4332
|
+
if (err.code === "ENOENT") {
|
|
4333
|
+
await mkdir.mkdirs(dir);
|
|
4334
|
+
await fs3.writeFile(file, "");
|
|
4335
|
+
return;
|
|
4336
|
+
} else {
|
|
4337
|
+
throw err;
|
|
4338
|
+
}
|
|
4339
|
+
}
|
|
4340
|
+
if (dirStats.isDirectory()) {
|
|
4341
|
+
await fs3.writeFile(file, "");
|
|
4342
|
+
} else {
|
|
4343
|
+
await fs3.readdir(dir);
|
|
4668
4344
|
}
|
|
4669
|
-
__name(makeFile, "makeFile");
|
|
4670
|
-
fs3.stat(file, (err, stats) => {
|
|
4671
|
-
if (!err && stats.isFile()) return callback();
|
|
4672
|
-
const dir = path3.dirname(file);
|
|
4673
|
-
fs3.stat(dir, (err2, stats2) => {
|
|
4674
|
-
if (err2) {
|
|
4675
|
-
if (err2.code === "ENOENT") {
|
|
4676
|
-
return mkdir.mkdirs(dir, (err3) => {
|
|
4677
|
-
if (err3) return callback(err3);
|
|
4678
|
-
makeFile();
|
|
4679
|
-
});
|
|
4680
|
-
}
|
|
4681
|
-
return callback(err2);
|
|
4682
|
-
}
|
|
4683
|
-
if (stats2.isDirectory()) makeFile();
|
|
4684
|
-
else {
|
|
4685
|
-
fs3.readdir(dir, (err3) => {
|
|
4686
|
-
if (err3) return callback(err3);
|
|
4687
|
-
});
|
|
4688
|
-
}
|
|
4689
|
-
});
|
|
4690
|
-
});
|
|
4691
4345
|
}
|
|
4692
4346
|
__name(createFile, "createFile");
|
|
4693
4347
|
function createFileSync(file) {
|
|
@@ -4716,49 +4370,47 @@ var require_file = __commonJS({
|
|
|
4716
4370
|
}
|
|
4717
4371
|
});
|
|
4718
4372
|
|
|
4719
|
-
// node_modules/fs-extra/lib/ensure/link.js
|
|
4373
|
+
// ../../../node_modules/fs-extra/lib/ensure/link.js
|
|
4720
4374
|
var require_link = __commonJS({
|
|
4721
|
-
"node_modules/fs-extra/lib/ensure/link.js"(exports2, module2) {
|
|
4375
|
+
"../../../node_modules/fs-extra/lib/ensure/link.js"(exports2, module2) {
|
|
4722
4376
|
"use strict";
|
|
4723
|
-
var u = require_universalify().
|
|
4377
|
+
var u = require_universalify().fromPromise;
|
|
4724
4378
|
var path3 = require("path");
|
|
4725
|
-
var fs3 =
|
|
4379
|
+
var fs3 = require_fs();
|
|
4726
4380
|
var mkdir = require_mkdirs();
|
|
4727
|
-
var pathExists = require_path_exists()
|
|
4728
|
-
|
|
4729
|
-
|
|
4730
|
-
|
|
4731
|
-
|
|
4732
|
-
|
|
4733
|
-
|
|
4381
|
+
var { pathExists } = require_path_exists();
|
|
4382
|
+
var { areIdentical } = require_stat();
|
|
4383
|
+
async function createLink(srcpath, dstpath) {
|
|
4384
|
+
let dstStat;
|
|
4385
|
+
try {
|
|
4386
|
+
dstStat = await fs3.lstat(dstpath);
|
|
4387
|
+
} catch {
|
|
4734
4388
|
}
|
|
4735
|
-
|
|
4736
|
-
|
|
4737
|
-
|
|
4738
|
-
|
|
4739
|
-
|
|
4740
|
-
|
|
4741
|
-
|
|
4742
|
-
|
|
4743
|
-
|
|
4744
|
-
|
|
4745
|
-
|
|
4746
|
-
|
|
4747
|
-
|
|
4748
|
-
|
|
4749
|
-
if (err4) return callback(err4);
|
|
4750
|
-
makeLink(srcpath, dstpath);
|
|
4751
|
-
});
|
|
4752
|
-
});
|
|
4753
|
-
});
|
|
4754
|
-
});
|
|
4389
|
+
let srcStat;
|
|
4390
|
+
try {
|
|
4391
|
+
srcStat = await fs3.lstat(srcpath);
|
|
4392
|
+
} catch (err) {
|
|
4393
|
+
err.message = err.message.replace("lstat", "ensureLink");
|
|
4394
|
+
throw err;
|
|
4395
|
+
}
|
|
4396
|
+
if (dstStat && areIdentical(srcStat, dstStat)) return;
|
|
4397
|
+
const dir = path3.dirname(dstpath);
|
|
4398
|
+
const dirExists = await pathExists(dir);
|
|
4399
|
+
if (!dirExists) {
|
|
4400
|
+
await mkdir.mkdirs(dir);
|
|
4401
|
+
}
|
|
4402
|
+
await fs3.link(srcpath, dstpath);
|
|
4755
4403
|
}
|
|
4756
4404
|
__name(createLink, "createLink");
|
|
4757
4405
|
function createLinkSync(srcpath, dstpath) {
|
|
4758
|
-
|
|
4759
|
-
if (destinationExists) return void 0;
|
|
4406
|
+
let dstStat;
|
|
4760
4407
|
try {
|
|
4761
|
-
fs3.lstatSync(
|
|
4408
|
+
dstStat = fs3.lstatSync(dstpath);
|
|
4409
|
+
} catch {
|
|
4410
|
+
}
|
|
4411
|
+
try {
|
|
4412
|
+
const srcStat = fs3.lstatSync(srcpath);
|
|
4413
|
+
if (dstStat && areIdentical(srcStat, dstStat)) return;
|
|
4762
4414
|
} catch (err) {
|
|
4763
4415
|
err.message = err.message.replace("lstat", "ensureLink");
|
|
4764
4416
|
throw err;
|
|
@@ -4777,106 +4429,101 @@ var require_link = __commonJS({
|
|
|
4777
4429
|
}
|
|
4778
4430
|
});
|
|
4779
4431
|
|
|
4780
|
-
// node_modules/fs-extra/lib/ensure/symlink-paths.js
|
|
4432
|
+
// ../../../node_modules/fs-extra/lib/ensure/symlink-paths.js
|
|
4781
4433
|
var require_symlink_paths = __commonJS({
|
|
4782
|
-
"node_modules/fs-extra/lib/ensure/symlink-paths.js"(exports2, module2) {
|
|
4434
|
+
"../../../node_modules/fs-extra/lib/ensure/symlink-paths.js"(exports2, module2) {
|
|
4783
4435
|
"use strict";
|
|
4784
4436
|
var path3 = require("path");
|
|
4785
|
-
var fs3 =
|
|
4786
|
-
var pathExists = require_path_exists()
|
|
4787
|
-
|
|
4437
|
+
var fs3 = require_fs();
|
|
4438
|
+
var { pathExists } = require_path_exists();
|
|
4439
|
+
var u = require_universalify().fromPromise;
|
|
4440
|
+
async function symlinkPaths(srcpath, dstpath) {
|
|
4788
4441
|
if (path3.isAbsolute(srcpath)) {
|
|
4789
|
-
|
|
4790
|
-
|
|
4791
|
-
|
|
4792
|
-
|
|
4793
|
-
|
|
4794
|
-
|
|
4795
|
-
|
|
4796
|
-
|
|
4797
|
-
|
|
4798
|
-
}
|
|
4799
|
-
}
|
|
4800
|
-
|
|
4801
|
-
|
|
4802
|
-
|
|
4803
|
-
|
|
4804
|
-
|
|
4805
|
-
|
|
4806
|
-
|
|
4807
|
-
|
|
4808
|
-
|
|
4809
|
-
|
|
4810
|
-
|
|
4811
|
-
|
|
4812
|
-
|
|
4813
|
-
|
|
4814
|
-
}
|
|
4815
|
-
return callback(null, {
|
|
4816
|
-
toCwd: srcpath,
|
|
4817
|
-
toDst: path3.relative(dstdir, srcpath)
|
|
4818
|
-
});
|
|
4819
|
-
});
|
|
4820
|
-
}
|
|
4821
|
-
});
|
|
4442
|
+
try {
|
|
4443
|
+
await fs3.lstat(srcpath);
|
|
4444
|
+
} catch (err) {
|
|
4445
|
+
err.message = err.message.replace("lstat", "ensureSymlink");
|
|
4446
|
+
throw err;
|
|
4447
|
+
}
|
|
4448
|
+
return {
|
|
4449
|
+
toCwd: srcpath,
|
|
4450
|
+
toDst: srcpath
|
|
4451
|
+
};
|
|
4452
|
+
}
|
|
4453
|
+
const dstdir = path3.dirname(dstpath);
|
|
4454
|
+
const relativeToDst = path3.join(dstdir, srcpath);
|
|
4455
|
+
const exists = await pathExists(relativeToDst);
|
|
4456
|
+
if (exists) {
|
|
4457
|
+
return {
|
|
4458
|
+
toCwd: relativeToDst,
|
|
4459
|
+
toDst: srcpath
|
|
4460
|
+
};
|
|
4461
|
+
}
|
|
4462
|
+
try {
|
|
4463
|
+
await fs3.lstat(srcpath);
|
|
4464
|
+
} catch (err) {
|
|
4465
|
+
err.message = err.message.replace("lstat", "ensureSymlink");
|
|
4466
|
+
throw err;
|
|
4822
4467
|
}
|
|
4468
|
+
return {
|
|
4469
|
+
toCwd: srcpath,
|
|
4470
|
+
toDst: path3.relative(dstdir, srcpath)
|
|
4471
|
+
};
|
|
4823
4472
|
}
|
|
4824
4473
|
__name(symlinkPaths, "symlinkPaths");
|
|
4825
4474
|
function symlinkPathsSync(srcpath, dstpath) {
|
|
4826
|
-
let exists;
|
|
4827
4475
|
if (path3.isAbsolute(srcpath)) {
|
|
4828
|
-
|
|
4829
|
-
if (!
|
|
4476
|
+
const exists2 = fs3.existsSync(srcpath);
|
|
4477
|
+
if (!exists2) throw new Error("absolute srcpath does not exist");
|
|
4830
4478
|
return {
|
|
4831
4479
|
toCwd: srcpath,
|
|
4832
4480
|
toDst: srcpath
|
|
4833
4481
|
};
|
|
4834
|
-
} else {
|
|
4835
|
-
const dstdir = path3.dirname(dstpath);
|
|
4836
|
-
const relativeToDst = path3.join(dstdir, srcpath);
|
|
4837
|
-
exists = fs3.existsSync(relativeToDst);
|
|
4838
|
-
if (exists) {
|
|
4839
|
-
return {
|
|
4840
|
-
toCwd: relativeToDst,
|
|
4841
|
-
toDst: srcpath
|
|
4842
|
-
};
|
|
4843
|
-
} else {
|
|
4844
|
-
exists = fs3.existsSync(srcpath);
|
|
4845
|
-
if (!exists) throw new Error("relative srcpath does not exist");
|
|
4846
|
-
return {
|
|
4847
|
-
toCwd: srcpath,
|
|
4848
|
-
toDst: path3.relative(dstdir, srcpath)
|
|
4849
|
-
};
|
|
4850
|
-
}
|
|
4851
4482
|
}
|
|
4483
|
+
const dstdir = path3.dirname(dstpath);
|
|
4484
|
+
const relativeToDst = path3.join(dstdir, srcpath);
|
|
4485
|
+
const exists = fs3.existsSync(relativeToDst);
|
|
4486
|
+
if (exists) {
|
|
4487
|
+
return {
|
|
4488
|
+
toCwd: relativeToDst,
|
|
4489
|
+
toDst: srcpath
|
|
4490
|
+
};
|
|
4491
|
+
}
|
|
4492
|
+
const srcExists = fs3.existsSync(srcpath);
|
|
4493
|
+
if (!srcExists) throw new Error("relative srcpath does not exist");
|
|
4494
|
+
return {
|
|
4495
|
+
toCwd: srcpath,
|
|
4496
|
+
toDst: path3.relative(dstdir, srcpath)
|
|
4497
|
+
};
|
|
4852
4498
|
}
|
|
4853
4499
|
__name(symlinkPathsSync, "symlinkPathsSync");
|
|
4854
4500
|
module2.exports = {
|
|
4855
|
-
symlinkPaths,
|
|
4501
|
+
symlinkPaths: u(symlinkPaths),
|
|
4856
4502
|
symlinkPathsSync
|
|
4857
4503
|
};
|
|
4858
4504
|
}
|
|
4859
4505
|
});
|
|
4860
4506
|
|
|
4861
|
-
// node_modules/fs-extra/lib/ensure/symlink-type.js
|
|
4507
|
+
// ../../../node_modules/fs-extra/lib/ensure/symlink-type.js
|
|
4862
4508
|
var require_symlink_type = __commonJS({
|
|
4863
|
-
"node_modules/fs-extra/lib/ensure/symlink-type.js"(exports2, module2) {
|
|
4509
|
+
"../../../node_modules/fs-extra/lib/ensure/symlink-type.js"(exports2, module2) {
|
|
4864
4510
|
"use strict";
|
|
4865
|
-
var fs3 =
|
|
4866
|
-
|
|
4867
|
-
|
|
4868
|
-
|
|
4869
|
-
|
|
4870
|
-
|
|
4871
|
-
|
|
4872
|
-
|
|
4873
|
-
|
|
4874
|
-
}
|
|
4511
|
+
var fs3 = require_fs();
|
|
4512
|
+
var u = require_universalify().fromPromise;
|
|
4513
|
+
async function symlinkType(srcpath, type) {
|
|
4514
|
+
if (type) return type;
|
|
4515
|
+
let stats;
|
|
4516
|
+
try {
|
|
4517
|
+
stats = await fs3.lstat(srcpath);
|
|
4518
|
+
} catch {
|
|
4519
|
+
return "file";
|
|
4520
|
+
}
|
|
4521
|
+
return stats && stats.isDirectory() ? "dir" : "file";
|
|
4875
4522
|
}
|
|
4876
4523
|
__name(symlinkType, "symlinkType");
|
|
4877
4524
|
function symlinkTypeSync(srcpath, type) {
|
|
4878
|
-
let stats;
|
|
4879
4525
|
if (type) return type;
|
|
4526
|
+
let stats;
|
|
4880
4527
|
try {
|
|
4881
4528
|
stats = fs3.lstatSync(srcpath);
|
|
4882
4529
|
} catch {
|
|
@@ -4886,57 +4533,78 @@ var require_symlink_type = __commonJS({
|
|
|
4886
4533
|
}
|
|
4887
4534
|
__name(symlinkTypeSync, "symlinkTypeSync");
|
|
4888
4535
|
module2.exports = {
|
|
4889
|
-
symlinkType,
|
|
4536
|
+
symlinkType: u(symlinkType),
|
|
4890
4537
|
symlinkTypeSync
|
|
4891
4538
|
};
|
|
4892
4539
|
}
|
|
4893
4540
|
});
|
|
4894
4541
|
|
|
4895
|
-
// node_modules/fs-extra/lib/ensure/symlink.js
|
|
4542
|
+
// ../../../node_modules/fs-extra/lib/ensure/symlink.js
|
|
4896
4543
|
var require_symlink = __commonJS({
|
|
4897
|
-
"node_modules/fs-extra/lib/ensure/symlink.js"(exports2, module2) {
|
|
4544
|
+
"../../../node_modules/fs-extra/lib/ensure/symlink.js"(exports2, module2) {
|
|
4898
4545
|
"use strict";
|
|
4899
|
-
var u = require_universalify().
|
|
4546
|
+
var u = require_universalify().fromPromise;
|
|
4900
4547
|
var path3 = require("path");
|
|
4901
|
-
var fs3 =
|
|
4902
|
-
var
|
|
4903
|
-
var
|
|
4904
|
-
var
|
|
4905
|
-
var
|
|
4906
|
-
var
|
|
4907
|
-
|
|
4908
|
-
|
|
4909
|
-
|
|
4910
|
-
|
|
4911
|
-
|
|
4912
|
-
|
|
4913
|
-
|
|
4914
|
-
|
|
4915
|
-
|
|
4916
|
-
|
|
4917
|
-
|
|
4918
|
-
|
|
4919
|
-
|
|
4920
|
-
|
|
4921
|
-
|
|
4922
|
-
|
|
4923
|
-
|
|
4924
|
-
|
|
4925
|
-
|
|
4926
|
-
|
|
4927
|
-
|
|
4928
|
-
|
|
4929
|
-
|
|
4930
|
-
|
|
4931
|
-
|
|
4932
|
-
|
|
4933
|
-
|
|
4934
|
-
|
|
4548
|
+
var fs3 = require_fs();
|
|
4549
|
+
var { mkdirs, mkdirsSync } = require_mkdirs();
|
|
4550
|
+
var { symlinkPaths, symlinkPathsSync } = require_symlink_paths();
|
|
4551
|
+
var { symlinkType, symlinkTypeSync } = require_symlink_type();
|
|
4552
|
+
var { pathExists } = require_path_exists();
|
|
4553
|
+
var { areIdentical } = require_stat();
|
|
4554
|
+
async function createSymlink(srcpath, dstpath, type) {
|
|
4555
|
+
let stats;
|
|
4556
|
+
try {
|
|
4557
|
+
stats = await fs3.lstat(dstpath);
|
|
4558
|
+
} catch {
|
|
4559
|
+
}
|
|
4560
|
+
if (stats && stats.isSymbolicLink()) {
|
|
4561
|
+
let srcStat;
|
|
4562
|
+
if (path3.isAbsolute(srcpath)) {
|
|
4563
|
+
srcStat = await fs3.stat(srcpath);
|
|
4564
|
+
} else {
|
|
4565
|
+
const dstdir = path3.dirname(dstpath);
|
|
4566
|
+
const relativeToDst = path3.join(dstdir, srcpath);
|
|
4567
|
+
try {
|
|
4568
|
+
srcStat = await fs3.stat(relativeToDst);
|
|
4569
|
+
} catch {
|
|
4570
|
+
srcStat = await fs3.stat(srcpath);
|
|
4571
|
+
}
|
|
4572
|
+
}
|
|
4573
|
+
const dstStat = await fs3.stat(dstpath);
|
|
4574
|
+
if (areIdentical(srcStat, dstStat)) return;
|
|
4575
|
+
}
|
|
4576
|
+
const relative2 = await symlinkPaths(srcpath, dstpath);
|
|
4577
|
+
srcpath = relative2.toDst;
|
|
4578
|
+
const toType = await symlinkType(relative2.toCwd, type);
|
|
4579
|
+
const dir = path3.dirname(dstpath);
|
|
4580
|
+
if (!await pathExists(dir)) {
|
|
4581
|
+
await mkdirs(dir);
|
|
4582
|
+
}
|
|
4583
|
+
return fs3.symlink(srcpath, dstpath, toType);
|
|
4935
4584
|
}
|
|
4936
4585
|
__name(createSymlink, "createSymlink");
|
|
4937
4586
|
function createSymlinkSync(srcpath, dstpath, type) {
|
|
4938
|
-
|
|
4939
|
-
|
|
4587
|
+
let stats;
|
|
4588
|
+
try {
|
|
4589
|
+
stats = fs3.lstatSync(dstpath);
|
|
4590
|
+
} catch {
|
|
4591
|
+
}
|
|
4592
|
+
if (stats && stats.isSymbolicLink()) {
|
|
4593
|
+
let srcStat;
|
|
4594
|
+
if (path3.isAbsolute(srcpath)) {
|
|
4595
|
+
srcStat = fs3.statSync(srcpath);
|
|
4596
|
+
} else {
|
|
4597
|
+
const dstdir = path3.dirname(dstpath);
|
|
4598
|
+
const relativeToDst = path3.join(dstdir, srcpath);
|
|
4599
|
+
try {
|
|
4600
|
+
srcStat = fs3.statSync(relativeToDst);
|
|
4601
|
+
} catch {
|
|
4602
|
+
srcStat = fs3.statSync(srcpath);
|
|
4603
|
+
}
|
|
4604
|
+
}
|
|
4605
|
+
const dstStat = fs3.statSync(dstpath);
|
|
4606
|
+
if (areIdentical(srcStat, dstStat)) return;
|
|
4607
|
+
}
|
|
4940
4608
|
const relative2 = symlinkPathsSync(srcpath, dstpath);
|
|
4941
4609
|
srcpath = relative2.toDst;
|
|
4942
4610
|
type = symlinkTypeSync(relative2.toCwd, type);
|
|
@@ -4954,35 +4622,35 @@ var require_symlink = __commonJS({
|
|
|
4954
4622
|
}
|
|
4955
4623
|
});
|
|
4956
4624
|
|
|
4957
|
-
// node_modules/fs-extra/lib/ensure/index.js
|
|
4625
|
+
// ../../../node_modules/fs-extra/lib/ensure/index.js
|
|
4958
4626
|
var require_ensure = __commonJS({
|
|
4959
|
-
"node_modules/fs-extra/lib/ensure/index.js"(exports2, module2) {
|
|
4627
|
+
"../../../node_modules/fs-extra/lib/ensure/index.js"(exports2, module2) {
|
|
4960
4628
|
"use strict";
|
|
4961
|
-
var
|
|
4962
|
-
var
|
|
4963
|
-
var
|
|
4629
|
+
var { createFile, createFileSync } = require_file();
|
|
4630
|
+
var { createLink, createLinkSync } = require_link();
|
|
4631
|
+
var { createSymlink, createSymlinkSync } = require_symlink();
|
|
4964
4632
|
module2.exports = {
|
|
4965
4633
|
// file
|
|
4966
|
-
createFile
|
|
4967
|
-
createFileSync
|
|
4968
|
-
ensureFile:
|
|
4969
|
-
ensureFileSync:
|
|
4634
|
+
createFile,
|
|
4635
|
+
createFileSync,
|
|
4636
|
+
ensureFile: createFile,
|
|
4637
|
+
ensureFileSync: createFileSync,
|
|
4970
4638
|
// link
|
|
4971
|
-
createLink
|
|
4972
|
-
createLinkSync
|
|
4973
|
-
ensureLink:
|
|
4974
|
-
ensureLinkSync:
|
|
4639
|
+
createLink,
|
|
4640
|
+
createLinkSync,
|
|
4641
|
+
ensureLink: createLink,
|
|
4642
|
+
ensureLinkSync: createLinkSync,
|
|
4975
4643
|
// symlink
|
|
4976
|
-
createSymlink
|
|
4977
|
-
createSymlinkSync
|
|
4978
|
-
ensureSymlink:
|
|
4979
|
-
ensureSymlinkSync:
|
|
4644
|
+
createSymlink,
|
|
4645
|
+
createSymlinkSync,
|
|
4646
|
+
ensureSymlink: createSymlink,
|
|
4647
|
+
ensureSymlinkSync: createSymlinkSync
|
|
4980
4648
|
};
|
|
4981
4649
|
}
|
|
4982
4650
|
});
|
|
4983
4651
|
|
|
4984
4652
|
// ../../../node_modules/jsonfile/utils.js
|
|
4985
|
-
var
|
|
4653
|
+
var require_utils2 = __commonJS({
|
|
4986
4654
|
"../../../node_modules/jsonfile/utils.js"(exports2, module2) {
|
|
4987
4655
|
function stringify(obj, { EOL = "\n", finalEOL = true, replacer = null, spaces } = {}) {
|
|
4988
4656
|
const EOF = finalEOL ? EOL : "";
|
|
@@ -5009,7 +4677,7 @@ var require_jsonfile = __commonJS({
|
|
|
5009
4677
|
_fs = require("fs");
|
|
5010
4678
|
}
|
|
5011
4679
|
var universalify = require_universalify();
|
|
5012
|
-
var { stringify, stripBom } =
|
|
4680
|
+
var { stringify, stripBom } = require_utils2();
|
|
5013
4681
|
async function _readFile(file, options = {}) {
|
|
5014
4682
|
if (typeof options === "string") {
|
|
5015
4683
|
options = { encoding: options };
|
|
@@ -5075,9 +4743,9 @@ var require_jsonfile = __commonJS({
|
|
|
5075
4743
|
}
|
|
5076
4744
|
});
|
|
5077
4745
|
|
|
5078
|
-
// node_modules/fs-extra/lib/json/jsonfile.js
|
|
4746
|
+
// ../../../node_modules/fs-extra/lib/json/jsonfile.js
|
|
5079
4747
|
var require_jsonfile2 = __commonJS({
|
|
5080
|
-
"node_modules/fs-extra/lib/json/jsonfile.js"(exports2, module2) {
|
|
4748
|
+
"../../../node_modules/fs-extra/lib/json/jsonfile.js"(exports2, module2) {
|
|
5081
4749
|
"use strict";
|
|
5082
4750
|
var jsonFile = require_jsonfile();
|
|
5083
4751
|
module2.exports = {
|
|
@@ -5090,37 +4758,28 @@ var require_jsonfile2 = __commonJS({
|
|
|
5090
4758
|
}
|
|
5091
4759
|
});
|
|
5092
4760
|
|
|
5093
|
-
// node_modules/fs-extra/lib/output/index.js
|
|
5094
|
-
var
|
|
5095
|
-
"node_modules/fs-extra/lib/output/index.js"(exports2, module2) {
|
|
4761
|
+
// ../../../node_modules/fs-extra/lib/output-file/index.js
|
|
4762
|
+
var require_output_file = __commonJS({
|
|
4763
|
+
"../../../node_modules/fs-extra/lib/output-file/index.js"(exports2, module2) {
|
|
5096
4764
|
"use strict";
|
|
5097
|
-
var u = require_universalify().
|
|
5098
|
-
var fs3 =
|
|
4765
|
+
var u = require_universalify().fromPromise;
|
|
4766
|
+
var fs3 = require_fs();
|
|
5099
4767
|
var path3 = require("path");
|
|
5100
4768
|
var mkdir = require_mkdirs();
|
|
5101
4769
|
var pathExists = require_path_exists().pathExists;
|
|
5102
|
-
function outputFile(file, data, encoding
|
|
5103
|
-
if (typeof encoding === "function") {
|
|
5104
|
-
callback = encoding;
|
|
5105
|
-
encoding = "utf8";
|
|
5106
|
-
}
|
|
4770
|
+
async function outputFile(file, data, encoding = "utf-8") {
|
|
5107
4771
|
const dir = path3.dirname(file);
|
|
5108
|
-
pathExists(dir
|
|
5109
|
-
|
|
5110
|
-
|
|
5111
|
-
|
|
5112
|
-
if (err2) return callback(err2);
|
|
5113
|
-
fs3.writeFile(file, data, encoding, callback);
|
|
5114
|
-
});
|
|
5115
|
-
});
|
|
4772
|
+
if (!await pathExists(dir)) {
|
|
4773
|
+
await mkdir.mkdirs(dir);
|
|
4774
|
+
}
|
|
4775
|
+
return fs3.writeFile(file, data, encoding);
|
|
5116
4776
|
}
|
|
5117
4777
|
__name(outputFile, "outputFile");
|
|
5118
4778
|
function outputFileSync(file, ...args) {
|
|
5119
4779
|
const dir = path3.dirname(file);
|
|
5120
|
-
if (fs3.existsSync(dir)) {
|
|
5121
|
-
|
|
4780
|
+
if (!fs3.existsSync(dir)) {
|
|
4781
|
+
mkdir.mkdirsSync(dir);
|
|
5122
4782
|
}
|
|
5123
|
-
mkdir.mkdirsSync(dir);
|
|
5124
4783
|
fs3.writeFileSync(file, ...args);
|
|
5125
4784
|
}
|
|
5126
4785
|
__name(outputFileSync, "outputFileSync");
|
|
@@ -5131,12 +4790,12 @@ var require_output = __commonJS({
|
|
|
5131
4790
|
}
|
|
5132
4791
|
});
|
|
5133
4792
|
|
|
5134
|
-
// node_modules/fs-extra/lib/json/output-json.js
|
|
4793
|
+
// ../../../node_modules/fs-extra/lib/json/output-json.js
|
|
5135
4794
|
var require_output_json = __commonJS({
|
|
5136
|
-
"node_modules/fs-extra/lib/json/output-json.js"(exports2, module2) {
|
|
4795
|
+
"../../../node_modules/fs-extra/lib/json/output-json.js"(exports2, module2) {
|
|
5137
4796
|
"use strict";
|
|
5138
|
-
var { stringify } =
|
|
5139
|
-
var { outputFile } =
|
|
4797
|
+
var { stringify } = require_utils2();
|
|
4798
|
+
var { outputFile } = require_output_file();
|
|
5140
4799
|
async function outputJson(file, data, options = {}) {
|
|
5141
4800
|
const str = stringify(data, options);
|
|
5142
4801
|
await outputFile(file, str, options);
|
|
@@ -5146,12 +4805,12 @@ var require_output_json = __commonJS({
|
|
|
5146
4805
|
}
|
|
5147
4806
|
});
|
|
5148
4807
|
|
|
5149
|
-
// node_modules/fs-extra/lib/json/output-json-sync.js
|
|
4808
|
+
// ../../../node_modules/fs-extra/lib/json/output-json-sync.js
|
|
5150
4809
|
var require_output_json_sync = __commonJS({
|
|
5151
|
-
"node_modules/fs-extra/lib/json/output-json-sync.js"(exports2, module2) {
|
|
4810
|
+
"../../../node_modules/fs-extra/lib/json/output-json-sync.js"(exports2, module2) {
|
|
5152
4811
|
"use strict";
|
|
5153
|
-
var { stringify } =
|
|
5154
|
-
var { outputFileSync } =
|
|
4812
|
+
var { stringify } = require_utils2();
|
|
4813
|
+
var { outputFileSync } = require_output_file();
|
|
5155
4814
|
function outputJsonSync(file, data, options) {
|
|
5156
4815
|
const str = stringify(data, options);
|
|
5157
4816
|
outputFileSync(file, str, options);
|
|
@@ -5161,9 +4820,9 @@ var require_output_json_sync = __commonJS({
|
|
|
5161
4820
|
}
|
|
5162
4821
|
});
|
|
5163
4822
|
|
|
5164
|
-
// node_modules/fs-extra/lib/json/index.js
|
|
4823
|
+
// ../../../node_modules/fs-extra/lib/json/index.js
|
|
5165
4824
|
var require_json = __commonJS({
|
|
5166
|
-
"node_modules/fs-extra/lib/json/index.js"(exports2, module2) {
|
|
4825
|
+
"../../../node_modules/fs-extra/lib/json/index.js"(exports2, module2) {
|
|
5167
4826
|
"use strict";
|
|
5168
4827
|
var u = require_universalify().fromPromise;
|
|
5169
4828
|
var jsonFile = require_jsonfile2();
|
|
@@ -5179,26 +4838,88 @@ var require_json = __commonJS({
|
|
|
5179
4838
|
}
|
|
5180
4839
|
});
|
|
5181
4840
|
|
|
5182
|
-
// node_modules/fs-extra/lib/move
|
|
4841
|
+
// ../../../node_modules/fs-extra/lib/move/move.js
|
|
4842
|
+
var require_move = __commonJS({
|
|
4843
|
+
"../../../node_modules/fs-extra/lib/move/move.js"(exports2, module2) {
|
|
4844
|
+
"use strict";
|
|
4845
|
+
var fs3 = require_fs();
|
|
4846
|
+
var path3 = require("path");
|
|
4847
|
+
var { copy } = require_copy2();
|
|
4848
|
+
var { remove } = require_remove();
|
|
4849
|
+
var { mkdirp } = require_mkdirs();
|
|
4850
|
+
var { pathExists } = require_path_exists();
|
|
4851
|
+
var stat2 = require_stat();
|
|
4852
|
+
async function move(src, dest, opts = {}) {
|
|
4853
|
+
const overwrite = opts.overwrite || opts.clobber || false;
|
|
4854
|
+
const { srcStat, isChangingCase = false } = await stat2.checkPaths(src, dest, "move", opts);
|
|
4855
|
+
await stat2.checkParentPaths(src, srcStat, dest, "move");
|
|
4856
|
+
const destParent = path3.dirname(dest);
|
|
4857
|
+
const parsedParentPath = path3.parse(destParent);
|
|
4858
|
+
if (parsedParentPath.root !== destParent) {
|
|
4859
|
+
await mkdirp(destParent);
|
|
4860
|
+
}
|
|
4861
|
+
return doRename(src, dest, overwrite, isChangingCase);
|
|
4862
|
+
}
|
|
4863
|
+
__name(move, "move");
|
|
4864
|
+
async function doRename(src, dest, overwrite, isChangingCase) {
|
|
4865
|
+
if (!isChangingCase) {
|
|
4866
|
+
if (overwrite) {
|
|
4867
|
+
await remove(dest);
|
|
4868
|
+
} else if (await pathExists(dest)) {
|
|
4869
|
+
throw new Error("dest already exists.");
|
|
4870
|
+
}
|
|
4871
|
+
}
|
|
4872
|
+
try {
|
|
4873
|
+
await fs3.rename(src, dest);
|
|
4874
|
+
} catch (err) {
|
|
4875
|
+
if (err.code !== "EXDEV") {
|
|
4876
|
+
throw err;
|
|
4877
|
+
}
|
|
4878
|
+
await moveAcrossDevice(src, dest, overwrite);
|
|
4879
|
+
}
|
|
4880
|
+
}
|
|
4881
|
+
__name(doRename, "doRename");
|
|
4882
|
+
async function moveAcrossDevice(src, dest, overwrite) {
|
|
4883
|
+
const opts = {
|
|
4884
|
+
overwrite,
|
|
4885
|
+
errorOnExist: true,
|
|
4886
|
+
preserveTimestamps: true
|
|
4887
|
+
};
|
|
4888
|
+
await copy(src, dest, opts);
|
|
4889
|
+
return remove(src);
|
|
4890
|
+
}
|
|
4891
|
+
__name(moveAcrossDevice, "moveAcrossDevice");
|
|
4892
|
+
module2.exports = move;
|
|
4893
|
+
}
|
|
4894
|
+
});
|
|
4895
|
+
|
|
4896
|
+
// ../../../node_modules/fs-extra/lib/move/move-sync.js
|
|
5183
4897
|
var require_move_sync = __commonJS({
|
|
5184
|
-
"node_modules/fs-extra/lib/move
|
|
4898
|
+
"../../../node_modules/fs-extra/lib/move/move-sync.js"(exports2, module2) {
|
|
5185
4899
|
"use strict";
|
|
5186
4900
|
var fs3 = require_graceful_fs();
|
|
5187
4901
|
var path3 = require("path");
|
|
5188
|
-
var copySync =
|
|
4902
|
+
var copySync = require_copy2().copySync;
|
|
5189
4903
|
var removeSync = require_remove().removeSync;
|
|
5190
4904
|
var mkdirpSync = require_mkdirs().mkdirpSync;
|
|
5191
4905
|
var stat2 = require_stat();
|
|
5192
4906
|
function moveSync(src, dest, opts) {
|
|
5193
4907
|
opts = opts || {};
|
|
5194
4908
|
const overwrite = opts.overwrite || opts.clobber || false;
|
|
5195
|
-
const { srcStat } = stat2.checkPathsSync(src, dest, "move");
|
|
4909
|
+
const { srcStat, isChangingCase = false } = stat2.checkPathsSync(src, dest, "move", opts);
|
|
5196
4910
|
stat2.checkParentPathsSync(src, srcStat, dest, "move");
|
|
5197
|
-
mkdirpSync(path3.dirname(dest));
|
|
5198
|
-
return doRename(src, dest, overwrite);
|
|
4911
|
+
if (!isParentRoot(dest)) mkdirpSync(path3.dirname(dest));
|
|
4912
|
+
return doRename(src, dest, overwrite, isChangingCase);
|
|
5199
4913
|
}
|
|
5200
4914
|
__name(moveSync, "moveSync");
|
|
5201
|
-
function
|
|
4915
|
+
function isParentRoot(dest) {
|
|
4916
|
+
const parent = path3.dirname(dest);
|
|
4917
|
+
const parsedPath = path3.parse(parent);
|
|
4918
|
+
return parsedPath.root === parent;
|
|
4919
|
+
}
|
|
4920
|
+
__name(isParentRoot, "isParentRoot");
|
|
4921
|
+
function doRename(src, dest, overwrite, isChangingCase) {
|
|
4922
|
+
if (isChangingCase) return rename(src, dest, overwrite);
|
|
5202
4923
|
if (overwrite) {
|
|
5203
4924
|
removeSync(dest);
|
|
5204
4925
|
return rename(src, dest, overwrite);
|
|
@@ -5219,7 +4940,8 @@ var require_move_sync = __commonJS({
|
|
|
5219
4940
|
function moveAcrossDevice(src, dest, overwrite) {
|
|
5220
4941
|
const opts = {
|
|
5221
4942
|
overwrite,
|
|
5222
|
-
errorOnExist: true
|
|
4943
|
+
errorOnExist: true,
|
|
4944
|
+
preserveTimestamps: true
|
|
5223
4945
|
};
|
|
5224
4946
|
copySync(src, dest, opts);
|
|
5225
4947
|
return removeSync(src);
|
|
@@ -5229,122 +4951,36 @@ var require_move_sync = __commonJS({
|
|
|
5229
4951
|
}
|
|
5230
4952
|
});
|
|
5231
4953
|
|
|
5232
|
-
// node_modules/fs-extra/lib/move
|
|
5233
|
-
var require_move_sync2 = __commonJS({
|
|
5234
|
-
"node_modules/fs-extra/lib/move-sync/index.js"(exports2, module2) {
|
|
5235
|
-
"use strict";
|
|
5236
|
-
module2.exports = {
|
|
5237
|
-
moveSync: require_move_sync()
|
|
5238
|
-
};
|
|
5239
|
-
}
|
|
5240
|
-
});
|
|
5241
|
-
|
|
5242
|
-
// node_modules/fs-extra/lib/move/move.js
|
|
5243
|
-
var require_move = __commonJS({
|
|
5244
|
-
"node_modules/fs-extra/lib/move/move.js"(exports2, module2) {
|
|
5245
|
-
"use strict";
|
|
5246
|
-
var fs3 = require_graceful_fs();
|
|
5247
|
-
var path3 = require("path");
|
|
5248
|
-
var copy = require_copy2().copy;
|
|
5249
|
-
var remove = require_remove().remove;
|
|
5250
|
-
var mkdirp = require_mkdirs().mkdirp;
|
|
5251
|
-
var pathExists = require_path_exists().pathExists;
|
|
5252
|
-
var stat2 = require_stat();
|
|
5253
|
-
function move(src, dest, opts, cb) {
|
|
5254
|
-
if (typeof opts === "function") {
|
|
5255
|
-
cb = opts;
|
|
5256
|
-
opts = {};
|
|
5257
|
-
}
|
|
5258
|
-
const overwrite = opts.overwrite || opts.clobber || false;
|
|
5259
|
-
stat2.checkPaths(src, dest, "move", (err, stats) => {
|
|
5260
|
-
if (err) return cb(err);
|
|
5261
|
-
const { srcStat } = stats;
|
|
5262
|
-
stat2.checkParentPaths(src, srcStat, dest, "move", (err2) => {
|
|
5263
|
-
if (err2) return cb(err2);
|
|
5264
|
-
mkdirp(path3.dirname(dest), (err3) => {
|
|
5265
|
-
if (err3) return cb(err3);
|
|
5266
|
-
return doRename(src, dest, overwrite, cb);
|
|
5267
|
-
});
|
|
5268
|
-
});
|
|
5269
|
-
});
|
|
5270
|
-
}
|
|
5271
|
-
__name(move, "move");
|
|
5272
|
-
function doRename(src, dest, overwrite, cb) {
|
|
5273
|
-
if (overwrite) {
|
|
5274
|
-
return remove(dest, (err) => {
|
|
5275
|
-
if (err) return cb(err);
|
|
5276
|
-
return rename(src, dest, overwrite, cb);
|
|
5277
|
-
});
|
|
5278
|
-
}
|
|
5279
|
-
pathExists(dest, (err, destExists) => {
|
|
5280
|
-
if (err) return cb(err);
|
|
5281
|
-
if (destExists) return cb(new Error("dest already exists."));
|
|
5282
|
-
return rename(src, dest, overwrite, cb);
|
|
5283
|
-
});
|
|
5284
|
-
}
|
|
5285
|
-
__name(doRename, "doRename");
|
|
5286
|
-
function rename(src, dest, overwrite, cb) {
|
|
5287
|
-
fs3.rename(src, dest, (err) => {
|
|
5288
|
-
if (!err) return cb();
|
|
5289
|
-
if (err.code !== "EXDEV") return cb(err);
|
|
5290
|
-
return moveAcrossDevice(src, dest, overwrite, cb);
|
|
5291
|
-
});
|
|
5292
|
-
}
|
|
5293
|
-
__name(rename, "rename");
|
|
5294
|
-
function moveAcrossDevice(src, dest, overwrite, cb) {
|
|
5295
|
-
const opts = {
|
|
5296
|
-
overwrite,
|
|
5297
|
-
errorOnExist: true
|
|
5298
|
-
};
|
|
5299
|
-
copy(src, dest, opts, (err) => {
|
|
5300
|
-
if (err) return cb(err);
|
|
5301
|
-
return remove(src, cb);
|
|
5302
|
-
});
|
|
5303
|
-
}
|
|
5304
|
-
__name(moveAcrossDevice, "moveAcrossDevice");
|
|
5305
|
-
module2.exports = move;
|
|
5306
|
-
}
|
|
5307
|
-
});
|
|
5308
|
-
|
|
5309
|
-
// node_modules/fs-extra/lib/move/index.js
|
|
4954
|
+
// ../../../node_modules/fs-extra/lib/move/index.js
|
|
5310
4955
|
var require_move2 = __commonJS({
|
|
5311
|
-
"node_modules/fs-extra/lib/move/index.js"(exports2, module2) {
|
|
4956
|
+
"../../../node_modules/fs-extra/lib/move/index.js"(exports2, module2) {
|
|
5312
4957
|
"use strict";
|
|
5313
|
-
var u = require_universalify().
|
|
4958
|
+
var u = require_universalify().fromPromise;
|
|
5314
4959
|
module2.exports = {
|
|
5315
|
-
move: u(require_move())
|
|
4960
|
+
move: u(require_move()),
|
|
4961
|
+
moveSync: require_move_sync()
|
|
5316
4962
|
};
|
|
5317
4963
|
}
|
|
5318
4964
|
});
|
|
5319
4965
|
|
|
5320
|
-
// node_modules/fs-extra/lib/index.js
|
|
4966
|
+
// ../../../node_modules/fs-extra/lib/index.js
|
|
5321
4967
|
var require_lib = __commonJS({
|
|
5322
|
-
"node_modules/fs-extra/lib/index.js"(exports2, module2) {
|
|
4968
|
+
"../../../node_modules/fs-extra/lib/index.js"(exports2, module2) {
|
|
5323
4969
|
"use strict";
|
|
5324
4970
|
module2.exports = {
|
|
5325
4971
|
// Export promiseified graceful-fs:
|
|
5326
4972
|
...require_fs(),
|
|
5327
4973
|
// Export extra methods:
|
|
5328
|
-
...require_copy_sync2(),
|
|
5329
4974
|
...require_copy2(),
|
|
5330
4975
|
...require_empty(),
|
|
5331
4976
|
...require_ensure(),
|
|
5332
4977
|
...require_json(),
|
|
5333
4978
|
...require_mkdirs(),
|
|
5334
|
-
...require_move_sync2(),
|
|
5335
4979
|
...require_move2(),
|
|
5336
|
-
...
|
|
4980
|
+
...require_output_file(),
|
|
5337
4981
|
...require_path_exists(),
|
|
5338
4982
|
...require_remove()
|
|
5339
4983
|
};
|
|
5340
|
-
var fs3 = require("fs");
|
|
5341
|
-
if (Object.getOwnPropertyDescriptor(fs3, "promises")) {
|
|
5342
|
-
Object.defineProperty(module2.exports, "promises", {
|
|
5343
|
-
get() {
|
|
5344
|
-
return fs3.promises;
|
|
5345
|
-
}
|
|
5346
|
-
});
|
|
5347
|
-
}
|
|
5348
4984
|
}
|
|
5349
4985
|
});
|
|
5350
4986
|
|