@supatest/cypress-reporter 0.0.6 → 0.0.7
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/index.cjs +930 -518
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +8 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.js +930 -518
- package/dist/index.js.map +1 -1
- package/package.json +13 -15
package/dist/index.cjs
CHANGED
|
@@ -36,10 +36,10 @@ var require_ms = __commonJS({
|
|
|
36
36
|
"use strict";
|
|
37
37
|
var s = 1e3;
|
|
38
38
|
var m = s * 60;
|
|
39
|
-
var
|
|
40
|
-
var d =
|
|
39
|
+
var h2 = m * 60;
|
|
40
|
+
var d = h2 * 24;
|
|
41
41
|
var w = d * 7;
|
|
42
|
-
var
|
|
42
|
+
var y2 = d * 365.25;
|
|
43
43
|
module2.exports = function(val, options) {
|
|
44
44
|
options = options || {};
|
|
45
45
|
var type = typeof val;
|
|
@@ -71,7 +71,7 @@ var require_ms = __commonJS({
|
|
|
71
71
|
case "yrs":
|
|
72
72
|
case "yr":
|
|
73
73
|
case "y":
|
|
74
|
-
return n *
|
|
74
|
+
return n * y2;
|
|
75
75
|
case "weeks":
|
|
76
76
|
case "week":
|
|
77
77
|
case "w":
|
|
@@ -85,7 +85,7 @@ var require_ms = __commonJS({
|
|
|
85
85
|
case "hrs":
|
|
86
86
|
case "hr":
|
|
87
87
|
case "h":
|
|
88
|
-
return n *
|
|
88
|
+
return n * h2;
|
|
89
89
|
case "minutes":
|
|
90
90
|
case "minute":
|
|
91
91
|
case "mins":
|
|
@@ -113,8 +113,8 @@ var require_ms = __commonJS({
|
|
|
113
113
|
if (msAbs >= d) {
|
|
114
114
|
return Math.round(ms / d) + "d";
|
|
115
115
|
}
|
|
116
|
-
if (msAbs >=
|
|
117
|
-
return Math.round(ms /
|
|
116
|
+
if (msAbs >= h2) {
|
|
117
|
+
return Math.round(ms / h2) + "h";
|
|
118
118
|
}
|
|
119
119
|
if (msAbs >= m) {
|
|
120
120
|
return Math.round(ms / m) + "m";
|
|
@@ -129,8 +129,8 @@ var require_ms = __commonJS({
|
|
|
129
129
|
if (msAbs >= d) {
|
|
130
130
|
return plural(ms, msAbs, d, "day");
|
|
131
131
|
}
|
|
132
|
-
if (msAbs >=
|
|
133
|
-
return plural(ms, msAbs,
|
|
132
|
+
if (msAbs >= h2) {
|
|
133
|
+
return plural(ms, msAbs, h2, "hour");
|
|
134
134
|
}
|
|
135
135
|
if (msAbs >= m) {
|
|
136
136
|
return plural(ms, msAbs, m, "minute");
|
|
@@ -168,8 +168,8 @@ var require_common = __commonJS({
|
|
|
168
168
|
createDebug.formatters = {};
|
|
169
169
|
function selectColor(namespace) {
|
|
170
170
|
let hash = 0;
|
|
171
|
-
for (let
|
|
172
|
-
hash = (hash << 5) - hash + namespace.charCodeAt(
|
|
171
|
+
for (let i2 = 0; i2 < namespace.length; i2++) {
|
|
172
|
+
hash = (hash << 5) - hash + namespace.charCodeAt(i2);
|
|
173
173
|
hash |= 0;
|
|
174
174
|
}
|
|
175
175
|
return createDebug.colors[Math.abs(hash) % createDebug.colors.length];
|
|
@@ -440,8 +440,8 @@ var require_browser = __commonJS({
|
|
|
440
440
|
if (!this.useColors) {
|
|
441
441
|
return;
|
|
442
442
|
}
|
|
443
|
-
const
|
|
444
|
-
args.splice(1, 0,
|
|
443
|
+
const c3 = "color: " + this.color;
|
|
444
|
+
args.splice(1, 0, c3, "color: inherit");
|
|
445
445
|
let index = 0;
|
|
446
446
|
let lastC = 0;
|
|
447
447
|
args[0].replace(/%[a-zA-Z%]/g, (match) => {
|
|
@@ -453,7 +453,7 @@ var require_browser = __commonJS({
|
|
|
453
453
|
lastC = index;
|
|
454
454
|
}
|
|
455
455
|
});
|
|
456
|
-
args.splice(lastC, 0,
|
|
456
|
+
args.splice(lastC, 0, c3);
|
|
457
457
|
}
|
|
458
458
|
exports2.log = console.debug || console.log || (() => {
|
|
459
459
|
});
|
|
@@ -468,15 +468,15 @@ var require_browser = __commonJS({
|
|
|
468
468
|
}
|
|
469
469
|
}
|
|
470
470
|
function load() {
|
|
471
|
-
let
|
|
471
|
+
let r2;
|
|
472
472
|
try {
|
|
473
|
-
|
|
473
|
+
r2 = exports2.storage.getItem("debug") || exports2.storage.getItem("DEBUG");
|
|
474
474
|
} catch (error) {
|
|
475
475
|
}
|
|
476
|
-
if (!
|
|
477
|
-
|
|
476
|
+
if (!r2 && typeof process !== "undefined" && "env" in process) {
|
|
477
|
+
r2 = process.env.DEBUG;
|
|
478
478
|
}
|
|
479
|
-
return
|
|
479
|
+
return r2;
|
|
480
480
|
}
|
|
481
481
|
function localstorage() {
|
|
482
482
|
try {
|
|
@@ -496,43 +496,35 @@ var require_browser = __commonJS({
|
|
|
496
496
|
}
|
|
497
497
|
});
|
|
498
498
|
|
|
499
|
-
// ../node_modules/.pnpm/has-flag@
|
|
499
|
+
// ../node_modules/.pnpm/has-flag@3.0.0/node_modules/has-flag/index.js
|
|
500
500
|
var require_has_flag = __commonJS({
|
|
501
|
-
"../node_modules/.pnpm/has-flag@
|
|
501
|
+
"../node_modules/.pnpm/has-flag@3.0.0/node_modules/has-flag/index.js"(exports2, module2) {
|
|
502
502
|
"use strict";
|
|
503
|
-
module2.exports = (flag, argv
|
|
503
|
+
module2.exports = (flag, argv) => {
|
|
504
|
+
argv = argv || process.argv;
|
|
504
505
|
const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--";
|
|
505
|
-
const
|
|
506
|
-
const
|
|
507
|
-
return
|
|
506
|
+
const pos = argv.indexOf(prefix + flag);
|
|
507
|
+
const terminatorPos = argv.indexOf("--");
|
|
508
|
+
return pos !== -1 && (terminatorPos === -1 ? true : pos < terminatorPos);
|
|
508
509
|
};
|
|
509
510
|
}
|
|
510
511
|
});
|
|
511
512
|
|
|
512
|
-
// ../node_modules/.pnpm/supports-color@
|
|
513
|
+
// ../node_modules/.pnpm/supports-color@5.5.0/node_modules/supports-color/index.js
|
|
513
514
|
var require_supports_color = __commonJS({
|
|
514
|
-
"../node_modules/.pnpm/supports-color@
|
|
515
|
+
"../node_modules/.pnpm/supports-color@5.5.0/node_modules/supports-color/index.js"(exports2, module2) {
|
|
515
516
|
"use strict";
|
|
516
517
|
var os2 = require("os");
|
|
517
|
-
var tty = require("tty");
|
|
518
518
|
var hasFlag = require_has_flag();
|
|
519
|
-
var
|
|
520
|
-
var
|
|
521
|
-
if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false")
|
|
522
|
-
|
|
519
|
+
var env = process.env;
|
|
520
|
+
var forceColor;
|
|
521
|
+
if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false")) {
|
|
522
|
+
forceColor = false;
|
|
523
523
|
} else if (hasFlag("color") || hasFlag("colors") || hasFlag("color=true") || hasFlag("color=always")) {
|
|
524
|
-
|
|
524
|
+
forceColor = true;
|
|
525
525
|
}
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
if (env.FORCE_COLOR === "true") {
|
|
529
|
-
return 1;
|
|
530
|
-
}
|
|
531
|
-
if (env.FORCE_COLOR === "false") {
|
|
532
|
-
return 0;
|
|
533
|
-
}
|
|
534
|
-
return env.FORCE_COLOR.length === 0 ? 1 : Math.min(Number.parseInt(env.FORCE_COLOR, 10), 3);
|
|
535
|
-
}
|
|
526
|
+
if ("FORCE_COLOR" in env) {
|
|
527
|
+
forceColor = env.FORCE_COLOR.length === 0 || parseInt(env.FORCE_COLOR, 10) !== 0;
|
|
536
528
|
}
|
|
537
529
|
function translateLevel(level) {
|
|
538
530
|
if (level === 0) {
|
|
@@ -545,39 +537,29 @@ var require_supports_color = __commonJS({
|
|
|
545
537
|
has16m: level >= 3
|
|
546
538
|
};
|
|
547
539
|
}
|
|
548
|
-
function supportsColor(
|
|
549
|
-
|
|
550
|
-
if (noFlagForceColor !== void 0) {
|
|
551
|
-
flagForceColor = noFlagForceColor;
|
|
552
|
-
}
|
|
553
|
-
const forceColor = sniffFlags ? flagForceColor : noFlagForceColor;
|
|
554
|
-
if (forceColor === 0) {
|
|
540
|
+
function supportsColor(stream) {
|
|
541
|
+
if (forceColor === false) {
|
|
555
542
|
return 0;
|
|
556
543
|
}
|
|
557
|
-
if (
|
|
558
|
-
|
|
559
|
-
return 3;
|
|
560
|
-
}
|
|
561
|
-
if (hasFlag("color=256")) {
|
|
562
|
-
return 2;
|
|
563
|
-
}
|
|
544
|
+
if (hasFlag("color=16m") || hasFlag("color=full") || hasFlag("color=truecolor")) {
|
|
545
|
+
return 3;
|
|
564
546
|
}
|
|
565
|
-
if (
|
|
566
|
-
return
|
|
547
|
+
if (hasFlag("color=256")) {
|
|
548
|
+
return 2;
|
|
567
549
|
}
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
return min;
|
|
550
|
+
if (stream && !stream.isTTY && forceColor !== true) {
|
|
551
|
+
return 0;
|
|
571
552
|
}
|
|
553
|
+
const min = forceColor ? 1 : 0;
|
|
572
554
|
if (process.platform === "win32") {
|
|
573
555
|
const osRelease = os2.release().split(".");
|
|
574
|
-
if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
|
|
556
|
+
if (Number(process.versions.node.split(".")[0]) >= 8 && Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
|
|
575
557
|
return Number(osRelease[2]) >= 14931 ? 3 : 2;
|
|
576
558
|
}
|
|
577
559
|
return 1;
|
|
578
560
|
}
|
|
579
561
|
if ("CI" in env) {
|
|
580
|
-
if (["TRAVIS", "CIRCLECI", "APPVEYOR", "GITLAB_CI"
|
|
562
|
+
if (["TRAVIS", "CIRCLECI", "APPVEYOR", "GITLAB_CI"].some((sign) => sign in env) || env.CI_NAME === "codeship") {
|
|
581
563
|
return 1;
|
|
582
564
|
}
|
|
583
565
|
return min;
|
|
@@ -589,7 +571,7 @@ var require_supports_color = __commonJS({
|
|
|
589
571
|
return 3;
|
|
590
572
|
}
|
|
591
573
|
if ("TERM_PROGRAM" in env) {
|
|
592
|
-
const version =
|
|
574
|
+
const version = parseInt((env.TERM_PROGRAM_VERSION || "").split(".")[0], 10);
|
|
593
575
|
switch (env.TERM_PROGRAM) {
|
|
594
576
|
case "iTerm.app":
|
|
595
577
|
return version >= 3 ? 3 : 2;
|
|
@@ -606,19 +588,19 @@ var require_supports_color = __commonJS({
|
|
|
606
588
|
if ("COLORTERM" in env) {
|
|
607
589
|
return 1;
|
|
608
590
|
}
|
|
591
|
+
if (env.TERM === "dumb") {
|
|
592
|
+
return min;
|
|
593
|
+
}
|
|
609
594
|
return min;
|
|
610
595
|
}
|
|
611
|
-
function getSupportLevel(stream
|
|
612
|
-
const level = supportsColor(stream
|
|
613
|
-
streamIsTTY: stream && stream.isTTY,
|
|
614
|
-
...options
|
|
615
|
-
});
|
|
596
|
+
function getSupportLevel(stream) {
|
|
597
|
+
const level = supportsColor(stream);
|
|
616
598
|
return translateLevel(level);
|
|
617
599
|
}
|
|
618
600
|
module2.exports = {
|
|
619
601
|
supportsColor: getSupportLevel,
|
|
620
|
-
stdout: getSupportLevel(
|
|
621
|
-
stderr: getSupportLevel(
|
|
602
|
+
stdout: getSupportLevel(process.stdout),
|
|
603
|
+
stderr: getSupportLevel(process.stderr)
|
|
622
604
|
};
|
|
623
605
|
}
|
|
624
606
|
});
|
|
@@ -728,8 +710,8 @@ var require_node = __commonJS({
|
|
|
728
710
|
exports2.inspectOpts = Object.keys(process.env).filter((key) => {
|
|
729
711
|
return /^debug_/i.test(key);
|
|
730
712
|
}).reduce((obj, key) => {
|
|
731
|
-
const prop = key.substring(6).toLowerCase().replace(/_([a-z])/g, (
|
|
732
|
-
return
|
|
713
|
+
const prop = key.substring(6).toLowerCase().replace(/_([a-z])/g, (_2, k2) => {
|
|
714
|
+
return k2.toUpperCase();
|
|
733
715
|
});
|
|
734
716
|
let val = process.env[key];
|
|
735
717
|
if (/^(yes|on|true|enabled)$/i.test(val)) {
|
|
@@ -750,8 +732,8 @@ var require_node = __commonJS({
|
|
|
750
732
|
function formatArgs(args) {
|
|
751
733
|
const { namespace: name, useColors: useColors2 } = this;
|
|
752
734
|
if (useColors2) {
|
|
753
|
-
const
|
|
754
|
-
const colorCode = "\x1B[3" + (
|
|
735
|
+
const c3 = this.color;
|
|
736
|
+
const colorCode = "\x1B[3" + (c3 < 8 ? c3 : "8;5;" + c3);
|
|
755
737
|
const prefix = ` ${colorCode};1m${name} \x1B[0m`;
|
|
756
738
|
args[0] = prefix + args[0].split("\n").join("\n" + prefix);
|
|
757
739
|
args.push(colorCode + "m+" + module2.exports.humanize(this.diff) + "\x1B[0m");
|
|
@@ -781,8 +763,8 @@ var require_node = __commonJS({
|
|
|
781
763
|
function init(debug2) {
|
|
782
764
|
debug2.inspectOpts = {};
|
|
783
765
|
const keys = Object.keys(exports2.inspectOpts);
|
|
784
|
-
for (let
|
|
785
|
-
debug2.inspectOpts[keys[
|
|
766
|
+
for (let i2 = 0; i2 < keys.length; i2++) {
|
|
767
|
+
debug2.inspectOpts[keys[i2]] = exports2.inspectOpts[keys[i2]];
|
|
786
768
|
}
|
|
787
769
|
}
|
|
788
770
|
module2.exports = require_common()(exports2);
|
|
@@ -859,7 +841,7 @@ var require_dist = __commonJS({
|
|
|
859
841
|
"../node_modules/.pnpm/@kwsites+file-exists@1.1.1/node_modules/@kwsites/file-exists/dist/index.js"(exports2) {
|
|
860
842
|
"use strict";
|
|
861
843
|
function __export3(m) {
|
|
862
|
-
for (var
|
|
844
|
+
for (var p2 in m) if (!exports2.hasOwnProperty(p2)) exports2[p2] = m[p2];
|
|
863
845
|
}
|
|
864
846
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
865
847
|
__export3(require_src2());
|
|
@@ -916,36 +898,503 @@ __export(index_exports, {
|
|
|
916
898
|
});
|
|
917
899
|
module.exports = __toCommonJS(index_exports);
|
|
918
900
|
var import_node_fs = __toESM(require("fs"), 1);
|
|
919
|
-
var
|
|
901
|
+
var import_node_path2 = __toESM(require("path"), 1);
|
|
920
902
|
|
|
921
|
-
// ../node_modules/.pnpm/simple-git@3.
|
|
903
|
+
// ../node_modules/.pnpm/simple-git@3.36.0/node_modules/simple-git/dist/esm/index.js
|
|
922
904
|
var import_file_exists = __toESM(require_dist(), 1);
|
|
905
|
+
|
|
906
|
+
// ../node_modules/.pnpm/@simple-git+args-pathspec@1.0.3/node_modules/@simple-git/args-pathspec/dist/index.mjs
|
|
907
|
+
var t = /* @__PURE__ */ new WeakMap();
|
|
908
|
+
function c(...n) {
|
|
909
|
+
const e = new String(n);
|
|
910
|
+
return t.set(e, n), e;
|
|
911
|
+
}
|
|
912
|
+
function r(n) {
|
|
913
|
+
return n instanceof String && t.has(n);
|
|
914
|
+
}
|
|
915
|
+
function o(n) {
|
|
916
|
+
return t.get(n) ?? [];
|
|
917
|
+
}
|
|
918
|
+
|
|
919
|
+
// ../node_modules/.pnpm/simple-git@3.36.0/node_modules/simple-git/dist/esm/index.js
|
|
923
920
|
var import_debug = __toESM(require_src(), 1);
|
|
924
921
|
var import_child_process = require("child_process");
|
|
925
922
|
var import_promise_deferred = __toESM(require_dist2(), 1);
|
|
923
|
+
var import_node_path = require("path");
|
|
924
|
+
|
|
925
|
+
// ../node_modules/.pnpm/@simple-git+argv-parser@1.1.1/node_modules/@simple-git/argv-parser/dist/index.mjs
|
|
926
|
+
function* U(e, t2) {
|
|
927
|
+
const n = t2 === "global";
|
|
928
|
+
for (const o2 of e)
|
|
929
|
+
o2.isGlobal === n && (yield o2);
|
|
930
|
+
}
|
|
931
|
+
var k = /* @__PURE__ */ new Set([
|
|
932
|
+
"--add",
|
|
933
|
+
"--edit",
|
|
934
|
+
"--remove-section",
|
|
935
|
+
"--rename-section",
|
|
936
|
+
"--replace-all",
|
|
937
|
+
"--unset",
|
|
938
|
+
"--unset-all",
|
|
939
|
+
"-e"
|
|
940
|
+
]);
|
|
941
|
+
var S = /* @__PURE__ */ new Set([
|
|
942
|
+
"--get",
|
|
943
|
+
"--get-all",
|
|
944
|
+
"--get-color",
|
|
945
|
+
"--get-colorbool",
|
|
946
|
+
"--get-regexp",
|
|
947
|
+
"--get-urlmatch",
|
|
948
|
+
"--list",
|
|
949
|
+
"-l"
|
|
950
|
+
]);
|
|
951
|
+
var P = /* @__PURE__ */ new Set([
|
|
952
|
+
"edit",
|
|
953
|
+
"remove-section",
|
|
954
|
+
"rename-section",
|
|
955
|
+
"set",
|
|
956
|
+
"unset"
|
|
957
|
+
]);
|
|
958
|
+
var E = /* @__PURE__ */ new Set(["get", "get-color", "get-colorbool", "list"]);
|
|
959
|
+
function F(e, t2) {
|
|
960
|
+
var _a2;
|
|
961
|
+
for (const { name: o2 } of U(e, "task")) {
|
|
962
|
+
if (k.has(o2))
|
|
963
|
+
return p(true, t2);
|
|
964
|
+
if (S.has(o2))
|
|
965
|
+
return p(false, t2);
|
|
966
|
+
}
|
|
967
|
+
const n = (_a2 = t2.at(0)) == null ? void 0 : _a2.toLowerCase();
|
|
968
|
+
return n === void 0 ? null : P.has(n) ? p(true, t2.slice(1)) : E.has(n) ? p(false, t2.slice(1)) : t2.length === 1 ? p(false, t2) : p(true, t2);
|
|
969
|
+
}
|
|
970
|
+
function p(e = false, t2 = []) {
|
|
971
|
+
var _a2;
|
|
972
|
+
const n = (_a2 = t2.at(0)) == null ? void 0 : _a2.toLowerCase();
|
|
973
|
+
return n === void 0 ? null : {
|
|
974
|
+
isWrite: e,
|
|
975
|
+
isRead: !e,
|
|
976
|
+
key: n,
|
|
977
|
+
value: t2.at(1)
|
|
978
|
+
};
|
|
979
|
+
}
|
|
980
|
+
function A(e, t2) {
|
|
981
|
+
return t2.isWrite && t2.value !== void 0 ? { key: t2.key, value: t2.value, scope: e } : { key: t2.key, scope: e };
|
|
982
|
+
}
|
|
983
|
+
function M(e) {
|
|
984
|
+
const t2 = (e == null ? void 0 : e.indexOf("=")) || -1;
|
|
985
|
+
return !e || t2 < 0 ? null : {
|
|
986
|
+
key: e.slice(0, t2).trim().toLowerCase(),
|
|
987
|
+
value: e.slice(t2 + 1)
|
|
988
|
+
};
|
|
989
|
+
}
|
|
990
|
+
function N(e) {
|
|
991
|
+
for (const { name: t2 } of U(e, "task"))
|
|
992
|
+
switch (t2) {
|
|
993
|
+
case "--global":
|
|
994
|
+
return "global";
|
|
995
|
+
case "--system":
|
|
996
|
+
return "system";
|
|
997
|
+
case "--worktree":
|
|
998
|
+
return "worktree";
|
|
999
|
+
case "--local":
|
|
1000
|
+
return "local";
|
|
1001
|
+
case "--file":
|
|
1002
|
+
case "-f":
|
|
1003
|
+
return "file";
|
|
1004
|
+
}
|
|
1005
|
+
return "local";
|
|
1006
|
+
}
|
|
1007
|
+
function G({ name: e }) {
|
|
1008
|
+
if (e === "-c" || e === "--config")
|
|
1009
|
+
return "inline";
|
|
1010
|
+
if (e === "--config-env")
|
|
1011
|
+
return "env";
|
|
1012
|
+
}
|
|
1013
|
+
function* O(e) {
|
|
1014
|
+
for (const t2 of e) {
|
|
1015
|
+
const n = G(t2), o2 = n && M(t2.value);
|
|
1016
|
+
o2 && (yield {
|
|
1017
|
+
...o2,
|
|
1018
|
+
scope: n
|
|
1019
|
+
});
|
|
1020
|
+
}
|
|
1021
|
+
}
|
|
1022
|
+
function L(e, t2, n) {
|
|
1023
|
+
const o2 = {
|
|
1024
|
+
read: [],
|
|
1025
|
+
write: [...O(t2)]
|
|
1026
|
+
};
|
|
1027
|
+
return e === "config" && $(
|
|
1028
|
+
o2,
|
|
1029
|
+
N(t2),
|
|
1030
|
+
F(t2, n)
|
|
1031
|
+
), o2;
|
|
1032
|
+
}
|
|
1033
|
+
function $(e, t2, n) {
|
|
1034
|
+
if (n === null)
|
|
1035
|
+
return;
|
|
1036
|
+
const o2 = A(t2, n);
|
|
1037
|
+
n.isWrite ? e.write.push(o2) : e.read.push(o2);
|
|
1038
|
+
}
|
|
1039
|
+
var x = {
|
|
1040
|
+
short: /* @__PURE__ */ new Map([
|
|
1041
|
+
["c", true]
|
|
1042
|
+
// -c <k=v> set config key for this invocation
|
|
1043
|
+
])
|
|
1044
|
+
};
|
|
1045
|
+
var D = {
|
|
1046
|
+
short: new Map([
|
|
1047
|
+
["C", true],
|
|
1048
|
+
// -C <path> change working directory
|
|
1049
|
+
["P", false],
|
|
1050
|
+
// -P no pager (alias for --no-pager)
|
|
1051
|
+
["h", false],
|
|
1052
|
+
// -h help
|
|
1053
|
+
["p", false],
|
|
1054
|
+
// -p paginate
|
|
1055
|
+
["v", false],
|
|
1056
|
+
// -v version
|
|
1057
|
+
...x.short.entries()
|
|
1058
|
+
]),
|
|
1059
|
+
long: /* @__PURE__ */ new Set([
|
|
1060
|
+
"attr-source",
|
|
1061
|
+
"config-env",
|
|
1062
|
+
"exec-path",
|
|
1063
|
+
"git-dir",
|
|
1064
|
+
"list-cmds",
|
|
1065
|
+
"namespace",
|
|
1066
|
+
"super-prefix",
|
|
1067
|
+
"work-tree"
|
|
1068
|
+
])
|
|
1069
|
+
};
|
|
1070
|
+
var R = {
|
|
1071
|
+
clone: {
|
|
1072
|
+
short: /* @__PURE__ */ new Map([
|
|
1073
|
+
["b", true],
|
|
1074
|
+
// -b <branch>
|
|
1075
|
+
["j", true],
|
|
1076
|
+
// -j <n> parallel jobs
|
|
1077
|
+
["l", false],
|
|
1078
|
+
// -l local
|
|
1079
|
+
["n", false],
|
|
1080
|
+
// -n no-checkout
|
|
1081
|
+
["o", true],
|
|
1082
|
+
// -o <name> remote name
|
|
1083
|
+
["q", false],
|
|
1084
|
+
// -q quiet
|
|
1085
|
+
["s", false],
|
|
1086
|
+
// -s shared
|
|
1087
|
+
["u", true]
|
|
1088
|
+
// -u <upload-pack>
|
|
1089
|
+
]),
|
|
1090
|
+
long: /* @__PURE__ */ new Set(["branch", "config", "jobs", "origin", "upload-pack", "u", "template"])
|
|
1091
|
+
},
|
|
1092
|
+
commit: {
|
|
1093
|
+
short: /* @__PURE__ */ new Map([
|
|
1094
|
+
["C", true],
|
|
1095
|
+
// -C <commit> reuse message
|
|
1096
|
+
["F", true],
|
|
1097
|
+
// -F <file> read message from file
|
|
1098
|
+
["c", true],
|
|
1099
|
+
// -c <commit> reedit message
|
|
1100
|
+
["m", true],
|
|
1101
|
+
// -m <msg>
|
|
1102
|
+
["t", true]
|
|
1103
|
+
// -t <template>
|
|
1104
|
+
]),
|
|
1105
|
+
long: /* @__PURE__ */ new Set(["file", "message", "reedit-message", "reuse-message", "template"])
|
|
1106
|
+
},
|
|
1107
|
+
config: {
|
|
1108
|
+
short: /* @__PURE__ */ new Map([
|
|
1109
|
+
["e", false],
|
|
1110
|
+
// -e open editor
|
|
1111
|
+
["f", true],
|
|
1112
|
+
// -f <file>
|
|
1113
|
+
["l", false]
|
|
1114
|
+
// -l list
|
|
1115
|
+
]),
|
|
1116
|
+
long: /* @__PURE__ */ new Set(["blob", "comment", "default", "file", "type", "value"])
|
|
1117
|
+
},
|
|
1118
|
+
fetch: {
|
|
1119
|
+
short: /* @__PURE__ */ new Map(),
|
|
1120
|
+
long: /* @__PURE__ */ new Set(["upload-pack"])
|
|
1121
|
+
},
|
|
1122
|
+
init: {
|
|
1123
|
+
short: /* @__PURE__ */ new Map(),
|
|
1124
|
+
long: /* @__PURE__ */ new Set(["template"])
|
|
1125
|
+
},
|
|
1126
|
+
pull: {
|
|
1127
|
+
short: /* @__PURE__ */ new Map(),
|
|
1128
|
+
long: /* @__PURE__ */ new Set(["upload-pack"])
|
|
1129
|
+
},
|
|
1130
|
+
push: {
|
|
1131
|
+
short: /* @__PURE__ */ new Map(),
|
|
1132
|
+
long: /* @__PURE__ */ new Set(["exec", "receive-pack"])
|
|
1133
|
+
}
|
|
1134
|
+
};
|
|
1135
|
+
var T = { short: /* @__PURE__ */ new Map(), long: /* @__PURE__ */ new Set() };
|
|
1136
|
+
function I(e) {
|
|
1137
|
+
const t2 = R[e ?? ""] ?? T;
|
|
1138
|
+
return {
|
|
1139
|
+
short: new Map([...x.short.entries(), ...t2.short.entries()]),
|
|
1140
|
+
long: t2.long
|
|
1141
|
+
};
|
|
1142
|
+
}
|
|
1143
|
+
function b(e, t2 = D) {
|
|
1144
|
+
if (e.startsWith("--")) {
|
|
1145
|
+
const n = e.indexOf("=");
|
|
1146
|
+
if (n > 2)
|
|
1147
|
+
return [{ name: e.slice(0, n), value: e.slice(n + 1), needsNext: false }];
|
|
1148
|
+
const o2 = e.slice(2);
|
|
1149
|
+
return [{ name: e, needsNext: t2.long.has(o2) }];
|
|
1150
|
+
}
|
|
1151
|
+
if (e.length === 2) {
|
|
1152
|
+
const n = e.charAt(1), o2 = t2.short.get(n);
|
|
1153
|
+
return [{ name: e, needsNext: o2 === true }];
|
|
1154
|
+
}
|
|
1155
|
+
return W(e, t2.short);
|
|
1156
|
+
}
|
|
1157
|
+
function W(e, t2) {
|
|
1158
|
+
const n = e.slice(1).split(""), o2 = [];
|
|
1159
|
+
for (let s = 0; s < n.length; s++) {
|
|
1160
|
+
const r2 = n[s], l = t2.get(r2);
|
|
1161
|
+
if (l === void 0)
|
|
1162
|
+
return [{ name: e, needsNext: false }];
|
|
1163
|
+
if (l) {
|
|
1164
|
+
const a = n.slice(s + 1).join("");
|
|
1165
|
+
if (a && ![...a].every((w) => t2.has(w)))
|
|
1166
|
+
return o2.push({ name: `-${r2}`, value: a, needsNext: false }), o2;
|
|
1167
|
+
}
|
|
1168
|
+
o2.push({ name: `-${r2}`, needsNext: l });
|
|
1169
|
+
}
|
|
1170
|
+
return o2;
|
|
1171
|
+
}
|
|
1172
|
+
function j(e, t2 = []) {
|
|
1173
|
+
let n = 0;
|
|
1174
|
+
for (; n < e.length; ) {
|
|
1175
|
+
const o2 = String(e[n]);
|
|
1176
|
+
if (!o2.startsWith("-") || o2.length < 2) break;
|
|
1177
|
+
const s = b(o2);
|
|
1178
|
+
let r2 = n + 1;
|
|
1179
|
+
for (const l of s) {
|
|
1180
|
+
const a = {
|
|
1181
|
+
name: l.name,
|
|
1182
|
+
value: l.value,
|
|
1183
|
+
absorbedNext: false,
|
|
1184
|
+
isGlobal: true
|
|
1185
|
+
};
|
|
1186
|
+
l.needsNext && a.value === void 0 && r2 < e.length && (a.value = String(e[r2]), a.absorbedNext = true, r2++), t2.push(a);
|
|
1187
|
+
}
|
|
1188
|
+
n = r2;
|
|
1189
|
+
}
|
|
1190
|
+
return { flags: t2, taskIndex: n };
|
|
1191
|
+
}
|
|
1192
|
+
function B(e, t2, n = []) {
|
|
1193
|
+
const o2 = I(t2), s = [], r2 = [];
|
|
1194
|
+
let l = 0;
|
|
1195
|
+
for (; l < e.length; ) {
|
|
1196
|
+
const a = e[l];
|
|
1197
|
+
if (r(a)) {
|
|
1198
|
+
r2.push(...o(a)), l++;
|
|
1199
|
+
continue;
|
|
1200
|
+
}
|
|
1201
|
+
const f = String(a);
|
|
1202
|
+
if (f === "--") {
|
|
1203
|
+
for (let g = l + 1; g < e.length; g++) {
|
|
1204
|
+
const u = e[g];
|
|
1205
|
+
r(u) ? r2.push(...o(u)) : r2.push(String(u));
|
|
1206
|
+
}
|
|
1207
|
+
break;
|
|
1208
|
+
}
|
|
1209
|
+
if (!f.startsWith("-") || f.length < 2) {
|
|
1210
|
+
s.push(f), l++;
|
|
1211
|
+
continue;
|
|
1212
|
+
}
|
|
1213
|
+
const w = b(f, o2);
|
|
1214
|
+
let d = l + 1;
|
|
1215
|
+
for (const g of w) {
|
|
1216
|
+
const u = {
|
|
1217
|
+
name: g.name,
|
|
1218
|
+
value: g.value,
|
|
1219
|
+
absorbedNext: false,
|
|
1220
|
+
isGlobal: false
|
|
1221
|
+
};
|
|
1222
|
+
g.needsNext && u.value === void 0 && d < e.length && !r(e[d]) && (u.value = String(e[d]), u.absorbedNext = true, d++), n.push(u);
|
|
1223
|
+
}
|
|
1224
|
+
l = d;
|
|
1225
|
+
}
|
|
1226
|
+
return { flags: n, positionals: s, pathspecs: r2 };
|
|
1227
|
+
}
|
|
1228
|
+
function* V({
|
|
1229
|
+
write: e
|
|
1230
|
+
}) {
|
|
1231
|
+
for (const t2 of e)
|
|
1232
|
+
for (const n of q) {
|
|
1233
|
+
const o2 = n(t2.key);
|
|
1234
|
+
o2 && (yield o2);
|
|
1235
|
+
}
|
|
1236
|
+
}
|
|
1237
|
+
function c2(e, t2, n = String(e)) {
|
|
1238
|
+
const o2 = typeof e == "string" ? new RegExp(`\\s*${e.toLowerCase()}`) : e;
|
|
1239
|
+
return function(r2) {
|
|
1240
|
+
if (o2.test(r2))
|
|
1241
|
+
return {
|
|
1242
|
+
category: t2,
|
|
1243
|
+
message: `Configuring ${n} is not permitted without enabling ${t2}`
|
|
1244
|
+
};
|
|
1245
|
+
};
|
|
1246
|
+
}
|
|
1247
|
+
function i(e, t2) {
|
|
1248
|
+
const n = new RegExp(`\\s*${e.toLowerCase().replace(/\./g, "(..+)?.")}`);
|
|
1249
|
+
return c2(n, t2, e);
|
|
1250
|
+
}
|
|
1251
|
+
var q = [
|
|
1252
|
+
c2("alias", "allowUnsafeAlias"),
|
|
1253
|
+
c2("core.askPass", "allowUnsafeAskPass"),
|
|
1254
|
+
c2("core.editor", "allowUnsafeEditor"),
|
|
1255
|
+
c2("core.fsmonitor", "allowUnsafeFsMonitor"),
|
|
1256
|
+
c2("core.gitProxy", "allowUnsafeGitProxy"),
|
|
1257
|
+
c2("core.hooksPath", "allowUnsafeHooksPath"),
|
|
1258
|
+
c2("core.pager", "allowUnsafePager"),
|
|
1259
|
+
c2("core.sshCommand", "allowUnsafeSshCommand"),
|
|
1260
|
+
i("credential.helper", "allowUnsafeCredentialHelper"),
|
|
1261
|
+
i("diff.command", "allowUnsafeDiffExternal"),
|
|
1262
|
+
c2("diff.external", "allowUnsafeDiffExternal"),
|
|
1263
|
+
i("diff.textconv", "allowUnsafeDiffTextConv"),
|
|
1264
|
+
i("filter.clean", "allowUnsafeFilter"),
|
|
1265
|
+
i("filter.smudge", "allowUnsafeFilter"),
|
|
1266
|
+
i("gpg.program", "allowUnsafeGpgProgram"),
|
|
1267
|
+
c2("init.templateDir", "allowUnsafeTemplateDir"),
|
|
1268
|
+
i("merge.driver", "allowUnsafeMergeDriver"),
|
|
1269
|
+
i("mergetool.path", "allowUnsafeMergeDriver"),
|
|
1270
|
+
i("mergetool.cmd", "allowUnsafeMergeDriver"),
|
|
1271
|
+
i("protocol.allow", "allowUnsafeProtocolOverride"),
|
|
1272
|
+
i("remote.receivepack", "allowUnsafePack"),
|
|
1273
|
+
i("remote.uploadpack", "allowUnsafePack"),
|
|
1274
|
+
c2("sequence.editor", "allowUnsafeEditor")
|
|
1275
|
+
];
|
|
1276
|
+
function* K(e, t2) {
|
|
1277
|
+
for (const n of t2)
|
|
1278
|
+
for (const o2 of H) {
|
|
1279
|
+
const s = o2(e, n.name);
|
|
1280
|
+
s && (yield s);
|
|
1281
|
+
}
|
|
1282
|
+
}
|
|
1283
|
+
function h(e, t2, n, o2 = String(t2)) {
|
|
1284
|
+
const s = typeof t2 == "string" ? new RegExp(`\\s*${t2.toLowerCase()}`) : t2, r2 = `Use of ${e ? `${e} with option ` : ""}${o2} is not permitted without enabling ${n}`;
|
|
1285
|
+
return function(a, f) {
|
|
1286
|
+
if ((!e || a === e) && s.test(f))
|
|
1287
|
+
return {
|
|
1288
|
+
category: n,
|
|
1289
|
+
message: r2
|
|
1290
|
+
};
|
|
1291
|
+
};
|
|
1292
|
+
}
|
|
1293
|
+
var H = [
|
|
1294
|
+
h(
|
|
1295
|
+
null,
|
|
1296
|
+
/--(upload|receive)-pack/,
|
|
1297
|
+
"allowUnsafePack",
|
|
1298
|
+
"--upload-pack or --receive-pack"
|
|
1299
|
+
),
|
|
1300
|
+
h("clone", /^-\w*u/, "allowUnsafePack"),
|
|
1301
|
+
h("clone", "--u", "allowUnsafePack"),
|
|
1302
|
+
h("push", "--exec", "allowUnsafePack"),
|
|
1303
|
+
h(null, "--template", "allowUnsafeTemplateDir")
|
|
1304
|
+
];
|
|
1305
|
+
function C(e, t2, n) {
|
|
1306
|
+
return [...K(e, t2), ...V(n)];
|
|
1307
|
+
}
|
|
1308
|
+
function Y(...e) {
|
|
1309
|
+
const { flags: t2, taskIndex: n } = j(e), o2 = n < e.length ? String(e[n]).toLowerCase() : null, s = o2 !== null ? e.slice(n + 1) : [], { positionals: r2, pathspecs: l } = B(s, o2, t2), a = L(o2, t2, r2);
|
|
1310
|
+
return {
|
|
1311
|
+
task: o2,
|
|
1312
|
+
flags: t2.map(J),
|
|
1313
|
+
paths: l,
|
|
1314
|
+
config: a,
|
|
1315
|
+
vulnerabilities: z(C(o2, t2, a))
|
|
1316
|
+
};
|
|
1317
|
+
}
|
|
1318
|
+
function z(e) {
|
|
1319
|
+
return Object.defineProperty(e, "vulnerabilities", {
|
|
1320
|
+
value: e
|
|
1321
|
+
});
|
|
1322
|
+
}
|
|
1323
|
+
function J({ value: e, name: t2 }) {
|
|
1324
|
+
return e !== void 0 ? { name: t2, value: e } : { name: t2 };
|
|
1325
|
+
}
|
|
1326
|
+
var y = {
|
|
1327
|
+
editor: "allowUnsafeEditor",
|
|
1328
|
+
git_askpass: "allowUnsafeAskPass",
|
|
1329
|
+
git_config_global: "allowUnsafeConfigPaths",
|
|
1330
|
+
git_config_system: "allowUnsafeConfigPaths",
|
|
1331
|
+
git_config_count: "allowUnsafeConfigEnvCount",
|
|
1332
|
+
git_config: "allowUnsafeConfigPaths",
|
|
1333
|
+
git_editor: "allowUnsafeEditor",
|
|
1334
|
+
git_exec_path: "allowUnsafeConfigPaths",
|
|
1335
|
+
git_external_diff: "allowUnsafeDiffExternal",
|
|
1336
|
+
git_pager: "allowUnsafePager",
|
|
1337
|
+
git_proxy_command: "allowUnsafeGitProxy",
|
|
1338
|
+
git_template_dir: "allowUnsafeTemplateDir",
|
|
1339
|
+
git_sequence_editor: "allowUnsafeEditor",
|
|
1340
|
+
git_ssh: "allowUnsafeSshCommand",
|
|
1341
|
+
git_ssh_command: "allowUnsafeSshCommand",
|
|
1342
|
+
pager: "allowUnsafePager",
|
|
1343
|
+
prefix: "allowUnsafeConfigPaths",
|
|
1344
|
+
ssh_askpass: "allowUnsafeAskPass"
|
|
1345
|
+
};
|
|
1346
|
+
function* Q(e) {
|
|
1347
|
+
const t2 = parseInt(e.git_config_count ?? "0", 10);
|
|
1348
|
+
for (let n = 0; n < t2; n++) {
|
|
1349
|
+
const o2 = e[`git_config_key_${n}`], s = e[`git_config_value_${n}`];
|
|
1350
|
+
o2 !== void 0 && (yield { key: o2.toLowerCase().trim(), value: s, scope: "env" });
|
|
1351
|
+
}
|
|
1352
|
+
}
|
|
1353
|
+
function* X(e) {
|
|
1354
|
+
for (const t2 of Object.keys(e))
|
|
1355
|
+
if (_(t2)) {
|
|
1356
|
+
const n = y[t2];
|
|
1357
|
+
yield {
|
|
1358
|
+
category: n,
|
|
1359
|
+
message: `Use of "${t2.toUpperCase()}" is not permitted without enabling ${n}`
|
|
1360
|
+
};
|
|
1361
|
+
}
|
|
1362
|
+
}
|
|
1363
|
+
function _(e) {
|
|
1364
|
+
return Object.hasOwn(y, e);
|
|
1365
|
+
}
|
|
1366
|
+
function Z(e) {
|
|
1367
|
+
const t2 = {};
|
|
1368
|
+
for (const [n, o2] of Object.entries(e)) {
|
|
1369
|
+
const s = n.toLowerCase().trim();
|
|
1370
|
+
(_(s) || s.startsWith("git")) && (t2[s] = String(o2));
|
|
1371
|
+
}
|
|
1372
|
+
return t2;
|
|
1373
|
+
}
|
|
1374
|
+
function ee(e) {
|
|
1375
|
+
const t2 = Z(e), n = {
|
|
1376
|
+
read: [],
|
|
1377
|
+
write: [...Q(t2)]
|
|
1378
|
+
}, o2 = [
|
|
1379
|
+
...X(t2),
|
|
1380
|
+
...C(null, [], n)
|
|
1381
|
+
];
|
|
1382
|
+
return {
|
|
1383
|
+
config: n,
|
|
1384
|
+
vulnerabilities: o2
|
|
1385
|
+
};
|
|
1386
|
+
}
|
|
1387
|
+
function ne(e, t2) {
|
|
1388
|
+
return [...Y(...e).vulnerabilities, ...ee(t2).vulnerabilities];
|
|
1389
|
+
}
|
|
1390
|
+
|
|
1391
|
+
// ../node_modules/.pnpm/simple-git@3.36.0/node_modules/simple-git/dist/esm/index.js
|
|
926
1392
|
var import_promise_deferred2 = __toESM(require_dist2(), 1);
|
|
927
1393
|
var import_node_events = require("events");
|
|
928
1394
|
var __defProp2 = Object.defineProperty;
|
|
929
|
-
var __defProps = Object.defineProperties;
|
|
930
1395
|
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
931
|
-
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
932
1396
|
var __getOwnPropNames2 = Object.getOwnPropertyNames;
|
|
933
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
934
1397
|
var __hasOwnProp2 = Object.prototype.hasOwnProperty;
|
|
935
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
936
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
937
|
-
var __spreadValues = (a, b) => {
|
|
938
|
-
for (var prop in b || (b = {}))
|
|
939
|
-
if (__hasOwnProp2.call(b, prop))
|
|
940
|
-
__defNormalProp(a, prop, b[prop]);
|
|
941
|
-
if (__getOwnPropSymbols)
|
|
942
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
943
|
-
if (__propIsEnum.call(b, prop))
|
|
944
|
-
__defNormalProp(a, prop, b[prop]);
|
|
945
|
-
}
|
|
946
|
-
return a;
|
|
947
|
-
};
|
|
948
|
-
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
949
1398
|
var __esm = (fn, res) => function __init() {
|
|
950
1399
|
return fn && (res = (0, fn[__getOwnPropNames2(fn)[0]])(fn = 0)), res;
|
|
951
1400
|
};
|
|
@@ -965,44 +1414,6 @@ var __copyProps2 = (to, from, except, desc) => {
|
|
|
965
1414
|
return to;
|
|
966
1415
|
};
|
|
967
1416
|
var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
|
|
968
|
-
var __async = (__this, __arguments, generator) => {
|
|
969
|
-
return new Promise((resolve, reject) => {
|
|
970
|
-
var fulfilled = (value) => {
|
|
971
|
-
try {
|
|
972
|
-
step(generator.next(value));
|
|
973
|
-
} catch (e) {
|
|
974
|
-
reject(e);
|
|
975
|
-
}
|
|
976
|
-
};
|
|
977
|
-
var rejected = (value) => {
|
|
978
|
-
try {
|
|
979
|
-
step(generator.throw(value));
|
|
980
|
-
} catch (e) {
|
|
981
|
-
reject(e);
|
|
982
|
-
}
|
|
983
|
-
};
|
|
984
|
-
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
985
|
-
step((generator = generator.apply(__this, __arguments)).next());
|
|
986
|
-
});
|
|
987
|
-
};
|
|
988
|
-
function pathspec(...paths) {
|
|
989
|
-
const key = new String(paths);
|
|
990
|
-
cache.set(key, paths);
|
|
991
|
-
return key;
|
|
992
|
-
}
|
|
993
|
-
function isPathSpec(path2) {
|
|
994
|
-
return path2 instanceof String && cache.has(path2);
|
|
995
|
-
}
|
|
996
|
-
function toPaths(pathSpec) {
|
|
997
|
-
return cache.get(pathSpec) || [];
|
|
998
|
-
}
|
|
999
|
-
var cache;
|
|
1000
|
-
var init_pathspec = __esm({
|
|
1001
|
-
"src/lib/args/pathspec.ts"() {
|
|
1002
|
-
"use strict";
|
|
1003
|
-
cache = /* @__PURE__ */ new WeakMap();
|
|
1004
|
-
}
|
|
1005
|
-
});
|
|
1006
1417
|
var GitError;
|
|
1007
1418
|
var init_git_error = __esm({
|
|
1008
1419
|
"src/lib/errors/git-error.ts"() {
|
|
@@ -1042,7 +1453,10 @@ var init_task_configuration_error = __esm({
|
|
|
1042
1453
|
}
|
|
1043
1454
|
});
|
|
1044
1455
|
function asFunction(source) {
|
|
1045
|
-
|
|
1456
|
+
if (typeof source !== "function") {
|
|
1457
|
+
return NOOP;
|
|
1458
|
+
}
|
|
1459
|
+
return source;
|
|
1046
1460
|
}
|
|
1047
1461
|
function isUserFunction(source) {
|
|
1048
1462
|
return typeof source === "function" && source !== NOOP;
|
|
@@ -1063,7 +1477,7 @@ function last(input, offset = 0) {
|
|
|
1063
1477
|
}
|
|
1064
1478
|
}
|
|
1065
1479
|
function isArrayLike(input) {
|
|
1066
|
-
return
|
|
1480
|
+
return filterHasLength(input);
|
|
1067
1481
|
}
|
|
1068
1482
|
function toLinesWithContent(input = "", trimmed2 = true, separator = "\n") {
|
|
1069
1483
|
return input.split(separator).reduce((output, line) => {
|
|
@@ -1116,19 +1530,21 @@ function asCamelCase(str) {
|
|
|
1116
1530
|
});
|
|
1117
1531
|
}
|
|
1118
1532
|
function asStringArray(source) {
|
|
1119
|
-
return asArray(source).map(
|
|
1533
|
+
return asArray(source).map((item) => {
|
|
1534
|
+
return item instanceof String ? item : String(item);
|
|
1535
|
+
});
|
|
1120
1536
|
}
|
|
1121
1537
|
function asNumber(source, onNaN = 0) {
|
|
1122
1538
|
if (source == null) {
|
|
1123
1539
|
return onNaN;
|
|
1124
1540
|
}
|
|
1125
1541
|
const num = parseInt(source, 10);
|
|
1126
|
-
return isNaN(num) ? onNaN : num;
|
|
1542
|
+
return Number.isNaN(num) ? onNaN : num;
|
|
1127
1543
|
}
|
|
1128
1544
|
function prefixedArray(input, prefix) {
|
|
1129
1545
|
const output = [];
|
|
1130
|
-
for (let
|
|
1131
|
-
output.push(prefix, input[
|
|
1546
|
+
for (let i2 = 0, max = input.length; i2 < max; i2++) {
|
|
1547
|
+
output.push(prefix, input[i2]);
|
|
1132
1548
|
}
|
|
1133
1549
|
return output;
|
|
1134
1550
|
}
|
|
@@ -1136,10 +1552,13 @@ function bufferToString(input) {
|
|
|
1136
1552
|
return (Array.isArray(input) ? Buffer.concat(input) : input).toString("utf-8");
|
|
1137
1553
|
}
|
|
1138
1554
|
function pick(source, properties) {
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1555
|
+
const out = {};
|
|
1556
|
+
properties.forEach((key) => {
|
|
1557
|
+
if (source[key] !== void 0) {
|
|
1558
|
+
out[key] = source[key];
|
|
1559
|
+
}
|
|
1560
|
+
});
|
|
1561
|
+
return out;
|
|
1143
1562
|
}
|
|
1144
1563
|
function delay(duration = 0) {
|
|
1145
1564
|
return new Promise((done) => setTimeout(done, duration));
|
|
@@ -1156,6 +1575,7 @@ var objectToString;
|
|
|
1156
1575
|
var init_util = __esm({
|
|
1157
1576
|
"src/lib/utils/util.ts"() {
|
|
1158
1577
|
"use strict";
|
|
1578
|
+
init_argument_filters();
|
|
1159
1579
|
NULL = "\0";
|
|
1160
1580
|
NOOP = () => {
|
|
1161
1581
|
};
|
|
@@ -1169,7 +1589,7 @@ function filterType(input, filter, def) {
|
|
|
1169
1589
|
return arguments.length > 2 ? def : void 0;
|
|
1170
1590
|
}
|
|
1171
1591
|
function filterPrimitives(input, omit) {
|
|
1172
|
-
const type =
|
|
1592
|
+
const type = r(input) ? "string" : typeof input;
|
|
1173
1593
|
return /number|string|boolean/.test(type) && (!omit || !omit.includes(type));
|
|
1174
1594
|
}
|
|
1175
1595
|
function filterPlainObject(input) {
|
|
@@ -1179,23 +1599,22 @@ function filterFunction(input) {
|
|
|
1179
1599
|
return typeof input === "function";
|
|
1180
1600
|
}
|
|
1181
1601
|
var filterArray;
|
|
1602
|
+
var filterNumber;
|
|
1182
1603
|
var filterString;
|
|
1183
|
-
var filterStringArray;
|
|
1184
1604
|
var filterStringOrStringArray;
|
|
1185
1605
|
var filterHasLength;
|
|
1186
1606
|
var init_argument_filters = __esm({
|
|
1187
1607
|
"src/lib/utils/argument-filters.ts"() {
|
|
1188
1608
|
"use strict";
|
|
1189
1609
|
init_util();
|
|
1190
|
-
init_pathspec();
|
|
1191
1610
|
filterArray = (input) => {
|
|
1192
1611
|
return Array.isArray(input);
|
|
1193
1612
|
};
|
|
1194
|
-
|
|
1195
|
-
return typeof input === "
|
|
1613
|
+
filterNumber = (input) => {
|
|
1614
|
+
return typeof input === "number";
|
|
1196
1615
|
};
|
|
1197
|
-
|
|
1198
|
-
return
|
|
1616
|
+
filterString = (input) => {
|
|
1617
|
+
return typeof input === "string" || r(input);
|
|
1199
1618
|
};
|
|
1200
1619
|
filterStringOrStringArray = (input) => {
|
|
1201
1620
|
return filterString(input) || Array.isArray(input) && input.every(filterString);
|
|
@@ -1204,7 +1623,7 @@ var init_argument_filters = __esm({
|
|
|
1204
1623
|
if (input == null || "number|boolean|function".includes(typeof input)) {
|
|
1205
1624
|
return false;
|
|
1206
1625
|
}
|
|
1207
|
-
return
|
|
1626
|
+
return typeof input.length === "number";
|
|
1208
1627
|
};
|
|
1209
1628
|
}
|
|
1210
1629
|
});
|
|
@@ -1225,17 +1644,20 @@ var GitOutputStreams;
|
|
|
1225
1644
|
var init_git_output_streams = __esm({
|
|
1226
1645
|
"src/lib/utils/git-output-streams.ts"() {
|
|
1227
1646
|
"use strict";
|
|
1228
|
-
GitOutputStreams = class {
|
|
1647
|
+
GitOutputStreams = class _GitOutputStreams {
|
|
1229
1648
|
constructor(stdOut, stdErr) {
|
|
1230
1649
|
this.stdOut = stdOut;
|
|
1231
1650
|
this.stdErr = stdErr;
|
|
1232
1651
|
}
|
|
1233
1652
|
asStrings() {
|
|
1234
|
-
return new
|
|
1653
|
+
return new _GitOutputStreams(this.stdOut.toString("utf8"), this.stdErr.toString("utf8"));
|
|
1235
1654
|
}
|
|
1236
1655
|
};
|
|
1237
1656
|
}
|
|
1238
1657
|
});
|
|
1658
|
+
function useMatchesDefault() {
|
|
1659
|
+
throw new Error(`LineParser:useMatches not implemented`);
|
|
1660
|
+
}
|
|
1239
1661
|
var LineParser;
|
|
1240
1662
|
var RemoteLineParser;
|
|
1241
1663
|
var init_line_parser = __esm({
|
|
@@ -1244,6 +1666,7 @@ var init_line_parser = __esm({
|
|
|
1244
1666
|
LineParser = class {
|
|
1245
1667
|
constructor(regExp, useMatches) {
|
|
1246
1668
|
this.matches = [];
|
|
1669
|
+
this.useMatches = useMatchesDefault;
|
|
1247
1670
|
this.parse = (line, target) => {
|
|
1248
1671
|
this.resetMatches();
|
|
1249
1672
|
if (!this._regExp.every((reg, index) => this.addMatch(reg, index, line(index)))) {
|
|
@@ -1256,9 +1679,6 @@ var init_line_parser = __esm({
|
|
|
1256
1679
|
this.useMatches = useMatches;
|
|
1257
1680
|
}
|
|
1258
1681
|
}
|
|
1259
|
-
useMatches(target, match) {
|
|
1260
|
-
throw new Error(`LineParser:useMatches not implemented`);
|
|
1261
|
-
}
|
|
1262
1682
|
resetMatches() {
|
|
1263
1683
|
this.matches.length = 0;
|
|
1264
1684
|
}
|
|
@@ -1291,8 +1711,8 @@ var init_line_parser = __esm({
|
|
|
1291
1711
|
function createInstanceConfig(...options) {
|
|
1292
1712
|
const baseDir = process.cwd();
|
|
1293
1713
|
const config = Object.assign(
|
|
1294
|
-
|
|
1295
|
-
...options.filter((
|
|
1714
|
+
{ baseDir, ...defaultOptions },
|
|
1715
|
+
...options.filter((o2) => typeof o2 === "object" && o2)
|
|
1296
1716
|
);
|
|
1297
1717
|
config.baseDir = config.baseDir || baseDir;
|
|
1298
1718
|
config.trimmed = config.trimmed === true;
|
|
@@ -1316,10 +1736,16 @@ function appendTaskOptions(options, commands = []) {
|
|
|
1316
1736
|
}
|
|
1317
1737
|
return Object.keys(options).reduce((commands2, key) => {
|
|
1318
1738
|
const value = options[key];
|
|
1319
|
-
if (
|
|
1739
|
+
if (r(value)) {
|
|
1320
1740
|
commands2.push(value);
|
|
1321
1741
|
} else if (filterPrimitives(value, ["boolean"])) {
|
|
1322
1742
|
commands2.push(key + "=" + value);
|
|
1743
|
+
} else if (Array.isArray(value)) {
|
|
1744
|
+
for (const v of value) {
|
|
1745
|
+
if (!filterPrimitives(v, ["string", "number"])) {
|
|
1746
|
+
commands2.push(key + "=" + v);
|
|
1747
|
+
}
|
|
1748
|
+
}
|
|
1323
1749
|
} else {
|
|
1324
1750
|
commands2.push(key);
|
|
1325
1751
|
}
|
|
@@ -1328,9 +1754,9 @@ function appendTaskOptions(options, commands = []) {
|
|
|
1328
1754
|
}
|
|
1329
1755
|
function getTrailingOptions(args, initialPrimitive = 0, objectOnly = false) {
|
|
1330
1756
|
const command = [];
|
|
1331
|
-
for (let
|
|
1332
|
-
if ("string|number".includes(typeof args[
|
|
1333
|
-
command.push(String(args[
|
|
1757
|
+
for (let i2 = 0, max = initialPrimitive < 0 ? args.length : initialPrimitive; i2 < max; i2++) {
|
|
1758
|
+
if ("string|number".includes(typeof args[i2])) {
|
|
1759
|
+
command.push(String(args[i2]));
|
|
1334
1760
|
}
|
|
1335
1761
|
}
|
|
1336
1762
|
appendTaskOptions(trailingOptionsArgument(args), command);
|
|
@@ -1341,7 +1767,7 @@ function getTrailingOptions(args, initialPrimitive = 0, objectOnly = false) {
|
|
|
1341
1767
|
}
|
|
1342
1768
|
function trailingArrayArgument(args) {
|
|
1343
1769
|
const hasTrailingCallback = typeof last(args) === "function";
|
|
1344
|
-
return filterType(last(args, hasTrailingCallback ? 1 : 0), filterArray, []);
|
|
1770
|
+
return asStringArray(filterType(last(args, hasTrailingCallback ? 1 : 0), filterArray, []));
|
|
1345
1771
|
}
|
|
1346
1772
|
function trailingOptionsArgument(args) {
|
|
1347
1773
|
const hasTrailingCallback = filterFunction(last(args));
|
|
@@ -1356,7 +1782,6 @@ var init_task_options = __esm({
|
|
|
1356
1782
|
"use strict";
|
|
1357
1783
|
init_argument_filters();
|
|
1358
1784
|
init_util();
|
|
1359
|
-
init_pathspec();
|
|
1360
1785
|
}
|
|
1361
1786
|
});
|
|
1362
1787
|
function callTaskParser(parser4, streams) {
|
|
@@ -1364,12 +1789,12 @@ function callTaskParser(parser4, streams) {
|
|
|
1364
1789
|
}
|
|
1365
1790
|
function parseStringResponse(result, parsers12, texts, trim = true) {
|
|
1366
1791
|
asArray(texts).forEach((text) => {
|
|
1367
|
-
for (let lines = toLinesWithContent(text, trim),
|
|
1792
|
+
for (let lines = toLinesWithContent(text, trim), i2 = 0, max = lines.length; i2 < max; i2++) {
|
|
1368
1793
|
const line = (offset = 0) => {
|
|
1369
|
-
if (
|
|
1794
|
+
if (i2 + offset >= max) {
|
|
1370
1795
|
return;
|
|
1371
1796
|
}
|
|
1372
|
-
return lines[
|
|
1797
|
+
return lines[i2 + offset];
|
|
1373
1798
|
};
|
|
1374
1799
|
parsers12.some(({ parse }) => parse(line, result));
|
|
1375
1800
|
}
|
|
@@ -1404,10 +1829,10 @@ __export2(utils_exports, {
|
|
|
1404
1829
|
filterArray: () => filterArray,
|
|
1405
1830
|
filterFunction: () => filterFunction,
|
|
1406
1831
|
filterHasLength: () => filterHasLength,
|
|
1832
|
+
filterNumber: () => filterNumber,
|
|
1407
1833
|
filterPlainObject: () => filterPlainObject,
|
|
1408
1834
|
filterPrimitives: () => filterPrimitives,
|
|
1409
1835
|
filterString: () => filterString,
|
|
1410
|
-
filterStringArray: () => filterStringArray,
|
|
1411
1836
|
filterStringOrStringArray: () => filterStringOrStringArray,
|
|
1412
1837
|
filterType: () => filterType,
|
|
1413
1838
|
first: () => first,
|
|
@@ -1730,9 +2155,9 @@ function configFilePath(filePath) {
|
|
|
1730
2155
|
}
|
|
1731
2156
|
function* configParser(text, requestedKey = null) {
|
|
1732
2157
|
const lines = text.split("\0");
|
|
1733
|
-
for (let
|
|
1734
|
-
const file = configFilePath(lines[
|
|
1735
|
-
let value = lines[
|
|
2158
|
+
for (let i2 = 0, max = lines.length - 1; i2 < max; ) {
|
|
2159
|
+
const file = configFilePath(lines[i2++]);
|
|
2160
|
+
let value = lines[i2++];
|
|
1736
2161
|
let key = requestedKey;
|
|
1737
2162
|
if (value.includes("\n")) {
|
|
1738
2163
|
const line = splitOn(value, "\n");
|
|
@@ -1770,7 +2195,7 @@ var init_ConfigList = __esm({
|
|
|
1770
2195
|
}
|
|
1771
2196
|
addValue(file, key, value) {
|
|
1772
2197
|
const values = this.addFile(file);
|
|
1773
|
-
if (!
|
|
2198
|
+
if (!Object.hasOwn(values, key)) {
|
|
1774
2199
|
values[key] = value;
|
|
1775
2200
|
} else if (Array.isArray(values[key])) {
|
|
1776
2201
|
values[key].push(value);
|
|
@@ -1783,7 +2208,7 @@ var init_ConfigList = __esm({
|
|
|
1783
2208
|
}
|
|
1784
2209
|
});
|
|
1785
2210
|
function asConfigScope(scope, fallback) {
|
|
1786
|
-
if (typeof scope === "string" &&
|
|
2211
|
+
if (typeof scope === "string" && Object.hasOwn(GitConfigScope, scope)) {
|
|
1787
2212
|
return scope;
|
|
1788
2213
|
}
|
|
1789
2214
|
return fallback;
|
|
@@ -2004,13 +2429,14 @@ function getResetMode(mode) {
|
|
|
2004
2429
|
return;
|
|
2005
2430
|
}
|
|
2006
2431
|
function isValidResetMode(mode) {
|
|
2007
|
-
return
|
|
2432
|
+
return typeof mode === "string" && validResetModes.includes(mode);
|
|
2008
2433
|
}
|
|
2009
2434
|
var ResetMode;
|
|
2010
|
-
var
|
|
2435
|
+
var validResetModes;
|
|
2011
2436
|
var init_reset = __esm({
|
|
2012
2437
|
"src/lib/tasks/reset.ts"() {
|
|
2013
2438
|
"use strict";
|
|
2439
|
+
init_utils();
|
|
2014
2440
|
init_task();
|
|
2015
2441
|
ResetMode = /* @__PURE__ */ ((ResetMode2) => {
|
|
2016
2442
|
ResetMode2["MIXED"] = "mixed";
|
|
@@ -2020,7 +2446,7 @@ var init_reset = __esm({
|
|
|
2020
2446
|
ResetMode2["KEEP"] = "keep";
|
|
2021
2447
|
return ResetMode2;
|
|
2022
2448
|
})(ResetMode || {});
|
|
2023
|
-
|
|
2449
|
+
validResetModes = asStringArray(Object.values(ResetMode));
|
|
2024
2450
|
}
|
|
2025
2451
|
});
|
|
2026
2452
|
function createLog() {
|
|
@@ -2087,14 +2513,14 @@ var init_git_logger = __esm({
|
|
|
2087
2513
|
};
|
|
2088
2514
|
}
|
|
2089
2515
|
});
|
|
2090
|
-
var _TasksPendingQueue;
|
|
2091
2516
|
var TasksPendingQueue;
|
|
2092
2517
|
var init_tasks_pending_queue = __esm({
|
|
2093
2518
|
"src/lib/runners/tasks-pending-queue.ts"() {
|
|
2094
2519
|
"use strict";
|
|
2520
|
+
var _a2;
|
|
2095
2521
|
init_git_error();
|
|
2096
2522
|
init_git_logger();
|
|
2097
|
-
|
|
2523
|
+
TasksPendingQueue = (_a2 = class {
|
|
2098
2524
|
constructor(logLabel = "GitExecutor") {
|
|
2099
2525
|
this.logLabel = logLabel;
|
|
2100
2526
|
this._queue = /* @__PURE__ */ new Map();
|
|
@@ -2103,7 +2529,7 @@ var init_tasks_pending_queue = __esm({
|
|
|
2103
2529
|
return this._queue.get(task);
|
|
2104
2530
|
}
|
|
2105
2531
|
createProgress(task) {
|
|
2106
|
-
const name =
|
|
2532
|
+
const name = _a2.getName(task.commands[0]);
|
|
2107
2533
|
const logger = createLogger(this.logLabel, name);
|
|
2108
2534
|
return {
|
|
2109
2535
|
task,
|
|
@@ -2151,11 +2577,9 @@ var init_tasks_pending_queue = __esm({
|
|
|
2151
2577
|
return progress;
|
|
2152
2578
|
}
|
|
2153
2579
|
static getName(name = "empty") {
|
|
2154
|
-
return `task:${name}:${++
|
|
2580
|
+
return `task:${name}:${++_a2.counter}`;
|
|
2155
2581
|
}
|
|
2156
|
-
};
|
|
2157
|
-
TasksPendingQueue = _TasksPendingQueue;
|
|
2158
|
-
TasksPendingQueue.counter = 0;
|
|
2582
|
+
}, _a2.counter = 0, _a2);
|
|
2159
2583
|
}
|
|
2160
2584
|
});
|
|
2161
2585
|
function pluginContext(task, commands) {
|
|
@@ -2212,20 +2636,18 @@ var init_git_executor_chain = __esm({
|
|
|
2212
2636
|
this._queue.push(task);
|
|
2213
2637
|
return this._chain = this._chain.then(() => this.attemptTask(task));
|
|
2214
2638
|
}
|
|
2215
|
-
attemptTask(task) {
|
|
2216
|
-
|
|
2217
|
-
|
|
2218
|
-
|
|
2219
|
-
|
|
2220
|
-
|
|
2221
|
-
|
|
2222
|
-
|
|
2223
|
-
|
|
2224
|
-
|
|
2225
|
-
|
|
2226
|
-
|
|
2227
|
-
}
|
|
2228
|
-
});
|
|
2639
|
+
async attemptTask(task) {
|
|
2640
|
+
const onScheduleComplete = await this._scheduler.next();
|
|
2641
|
+
const onQueueComplete = () => this._queue.complete(task);
|
|
2642
|
+
try {
|
|
2643
|
+
const { logger } = this._queue.attempt(task);
|
|
2644
|
+
return await (isEmptyTask(task) ? this.attemptEmptyTask(task, logger) : this.attemptRemoteTask(task, logger));
|
|
2645
|
+
} catch (e) {
|
|
2646
|
+
throw this.onFatalException(task, e);
|
|
2647
|
+
} finally {
|
|
2648
|
+
onQueueComplete();
|
|
2649
|
+
onScheduleComplete();
|
|
2650
|
+
}
|
|
2229
2651
|
}
|
|
2230
2652
|
onFatalException(task, e) {
|
|
2231
2653
|
const gitError = e instanceof GitError ? Object.assign(e, { task }) : new GitError(task, e && String(e));
|
|
@@ -2233,34 +2655,29 @@ var init_git_executor_chain = __esm({
|
|
|
2233
2655
|
this._queue.fatal(gitError);
|
|
2234
2656
|
return gitError;
|
|
2235
2657
|
}
|
|
2236
|
-
attemptRemoteTask(task, logger) {
|
|
2237
|
-
|
|
2238
|
-
|
|
2239
|
-
|
|
2240
|
-
|
|
2241
|
-
[...task.commands],
|
|
2242
|
-
pluginContext(task, task.commands)
|
|
2243
|
-
);
|
|
2244
|
-
const raw = yield this.gitResponse(
|
|
2245
|
-
task,
|
|
2246
|
-
binary,
|
|
2247
|
-
args,
|
|
2248
|
-
this.outputHandler,
|
|
2249
|
-
logger.step("SPAWN")
|
|
2250
|
-
);
|
|
2251
|
-
const outputStreams = yield this.handleTaskData(task, args, raw, logger.step("HANDLE"));
|
|
2252
|
-
logger(`passing response to task's parser as a %s`, task.format);
|
|
2253
|
-
if (isBufferTask(task)) {
|
|
2254
|
-
return callTaskParser(task.parser, outputStreams);
|
|
2255
|
-
}
|
|
2256
|
-
return callTaskParser(task.parser, outputStreams.asStrings());
|
|
2658
|
+
async attemptRemoteTask(task, logger) {
|
|
2659
|
+
const binary = this._plugins.exec("spawn.binary", "", pluginContext(task, task.commands));
|
|
2660
|
+
const args = this._plugins.exec("spawn.args", [...task.commands], {
|
|
2661
|
+
...pluginContext(task, task.commands),
|
|
2662
|
+
env: { ...this.env }
|
|
2257
2663
|
});
|
|
2664
|
+
const raw = await this.gitResponse(
|
|
2665
|
+
task,
|
|
2666
|
+
binary,
|
|
2667
|
+
args,
|
|
2668
|
+
this.outputHandler,
|
|
2669
|
+
logger.step("SPAWN")
|
|
2670
|
+
);
|
|
2671
|
+
const outputStreams = await this.handleTaskData(task, args, raw, logger.step("HANDLE"));
|
|
2672
|
+
logger(`passing response to task's parser as a %s`, task.format);
|
|
2673
|
+
if (isBufferTask(task)) {
|
|
2674
|
+
return callTaskParser(task.parser, outputStreams);
|
|
2675
|
+
}
|
|
2676
|
+
return callTaskParser(task.parser, outputStreams.asStrings());
|
|
2258
2677
|
}
|
|
2259
|
-
attemptEmptyTask(task, logger) {
|
|
2260
|
-
|
|
2261
|
-
|
|
2262
|
-
return task.parser(this);
|
|
2263
|
-
});
|
|
2678
|
+
async attemptEmptyTask(task, logger) {
|
|
2679
|
+
logger(`empty task bypassing child process to call to task's parser`);
|
|
2680
|
+
return task.parser(this);
|
|
2264
2681
|
}
|
|
2265
2682
|
handleTaskData(task, args, result, logger) {
|
|
2266
2683
|
const { exitCode, rejection, stdOut, stdErr } = result;
|
|
@@ -2269,7 +2686,10 @@ var init_git_executor_chain = __esm({
|
|
|
2269
2686
|
const { error } = this._plugins.exec(
|
|
2270
2687
|
"task.error",
|
|
2271
2688
|
{ error: rejection },
|
|
2272
|
-
|
|
2689
|
+
{
|
|
2690
|
+
...pluginContext(task, args),
|
|
2691
|
+
...result
|
|
2692
|
+
}
|
|
2273
2693
|
);
|
|
2274
2694
|
if (error && task.onError) {
|
|
2275
2695
|
logger.info(`exitCode=%s handling with custom error handler`);
|
|
@@ -2302,79 +2722,80 @@ var init_git_executor_chain = __esm({
|
|
|
2302
2722
|
done(new GitOutputStreams(Buffer.concat(stdOut), Buffer.concat(stdErr)));
|
|
2303
2723
|
});
|
|
2304
2724
|
}
|
|
2305
|
-
gitResponse(task, command, args, outputHandler, logger) {
|
|
2306
|
-
|
|
2307
|
-
|
|
2308
|
-
|
|
2309
|
-
|
|
2310
|
-
|
|
2311
|
-
|
|
2312
|
-
|
|
2313
|
-
|
|
2314
|
-
|
|
2315
|
-
|
|
2725
|
+
async gitResponse(task, command, args, outputHandler, logger) {
|
|
2726
|
+
const outputLogger = logger.sibling("output");
|
|
2727
|
+
const spawnOptions = this._plugins.exec(
|
|
2728
|
+
"spawn.options",
|
|
2729
|
+
{
|
|
2730
|
+
cwd: this.cwd,
|
|
2731
|
+
env: this.env,
|
|
2732
|
+
windowsHide: true
|
|
2733
|
+
},
|
|
2734
|
+
pluginContext(task, task.commands)
|
|
2735
|
+
);
|
|
2736
|
+
return new Promise((done) => {
|
|
2737
|
+
const stdOut = [];
|
|
2738
|
+
const stdErr = [];
|
|
2739
|
+
logger.info(`%s %o`, command, args);
|
|
2740
|
+
logger("%O", spawnOptions);
|
|
2741
|
+
let rejection = this._beforeSpawn(task, args);
|
|
2742
|
+
if (rejection) {
|
|
2743
|
+
return done({
|
|
2744
|
+
stdOut,
|
|
2745
|
+
stdErr,
|
|
2746
|
+
exitCode: 9901,
|
|
2747
|
+
rejection
|
|
2748
|
+
});
|
|
2749
|
+
}
|
|
2750
|
+
this._plugins.exec("spawn.before", void 0, {
|
|
2751
|
+
...pluginContext(task, args),
|
|
2752
|
+
kill(reason) {
|
|
2753
|
+
rejection = reason || rejection;
|
|
2754
|
+
}
|
|
2755
|
+
});
|
|
2756
|
+
const spawned = (0, import_child_process.spawn)(command, args, spawnOptions);
|
|
2757
|
+
spawned.stdout.on(
|
|
2758
|
+
"data",
|
|
2759
|
+
onDataReceived(stdOut, "stdOut", logger, outputLogger.step("stdOut"))
|
|
2316
2760
|
);
|
|
2317
|
-
|
|
2318
|
-
|
|
2319
|
-
|
|
2320
|
-
|
|
2321
|
-
|
|
2322
|
-
|
|
2323
|
-
|
|
2324
|
-
|
|
2761
|
+
spawned.stderr.on(
|
|
2762
|
+
"data",
|
|
2763
|
+
onDataReceived(stdErr, "stdErr", logger, outputLogger.step("stdErr"))
|
|
2764
|
+
);
|
|
2765
|
+
spawned.on("error", onErrorReceived(stdErr, logger));
|
|
2766
|
+
if (outputHandler) {
|
|
2767
|
+
logger(`Passing child process stdOut/stdErr to custom outputHandler`);
|
|
2768
|
+
outputHandler(command, spawned.stdout, spawned.stderr, [...args]);
|
|
2769
|
+
}
|
|
2770
|
+
this._plugins.exec("spawn.after", void 0, {
|
|
2771
|
+
...pluginContext(task, args),
|
|
2772
|
+
spawned,
|
|
2773
|
+
close(exitCode, reason) {
|
|
2774
|
+
done({
|
|
2325
2775
|
stdOut,
|
|
2326
2776
|
stdErr,
|
|
2327
|
-
exitCode
|
|
2328
|
-
rejection
|
|
2777
|
+
exitCode,
|
|
2778
|
+
rejection: rejection || reason
|
|
2329
2779
|
});
|
|
2330
|
-
}
|
|
2331
|
-
|
|
2332
|
-
|
|
2333
|
-
|
|
2780
|
+
},
|
|
2781
|
+
kill(reason) {
|
|
2782
|
+
if (spawned.killed) {
|
|
2783
|
+
return;
|
|
2334
2784
|
}
|
|
2335
|
-
|
|
2336
|
-
|
|
2337
|
-
spawned.stdout.on(
|
|
2338
|
-
"data",
|
|
2339
|
-
onDataReceived(stdOut, "stdOut", logger, outputLogger.step("stdOut"))
|
|
2340
|
-
);
|
|
2341
|
-
spawned.stderr.on(
|
|
2342
|
-
"data",
|
|
2343
|
-
onDataReceived(stdErr, "stdErr", logger, outputLogger.step("stdErr"))
|
|
2344
|
-
);
|
|
2345
|
-
spawned.on("error", onErrorReceived(stdErr, logger));
|
|
2346
|
-
if (outputHandler) {
|
|
2347
|
-
logger(`Passing child process stdOut/stdErr to custom outputHandler`);
|
|
2348
|
-
outputHandler(command, spawned.stdout, spawned.stderr, [...args]);
|
|
2785
|
+
rejection = reason;
|
|
2786
|
+
spawned.kill("SIGINT");
|
|
2349
2787
|
}
|
|
2350
|
-
this._plugins.exec("spawn.after", void 0, __spreadProps(__spreadValues({}, pluginContext(task, args)), {
|
|
2351
|
-
spawned,
|
|
2352
|
-
close(exitCode, reason) {
|
|
2353
|
-
done({
|
|
2354
|
-
stdOut,
|
|
2355
|
-
stdErr,
|
|
2356
|
-
exitCode,
|
|
2357
|
-
rejection: rejection || reason
|
|
2358
|
-
});
|
|
2359
|
-
},
|
|
2360
|
-
kill(reason) {
|
|
2361
|
-
if (spawned.killed) {
|
|
2362
|
-
return;
|
|
2363
|
-
}
|
|
2364
|
-
rejection = reason;
|
|
2365
|
-
spawned.kill("SIGINT");
|
|
2366
|
-
}
|
|
2367
|
-
}));
|
|
2368
2788
|
});
|
|
2369
2789
|
});
|
|
2370
2790
|
}
|
|
2371
2791
|
_beforeSpawn(task, args) {
|
|
2372
2792
|
let rejection;
|
|
2373
|
-
this._plugins.exec("spawn.before", void 0,
|
|
2793
|
+
this._plugins.exec("spawn.before", void 0, {
|
|
2794
|
+
...pluginContext(task, args),
|
|
2374
2795
|
kill(reason) {
|
|
2375
2796
|
rejection = reason || rejection;
|
|
2376
2797
|
}
|
|
2377
|
-
})
|
|
2798
|
+
});
|
|
2378
2799
|
return rejection;
|
|
2379
2800
|
}
|
|
2380
2801
|
};
|
|
@@ -2534,7 +2955,7 @@ var init_count_objects = __esm({
|
|
|
2534
2955
|
/([a-z-]+): (\d+)$/,
|
|
2535
2956
|
(result, [key, value]) => {
|
|
2536
2957
|
const property = asCamelCase(key);
|
|
2537
|
-
if (
|
|
2958
|
+
if (Object.hasOwn(result, property)) {
|
|
2538
2959
|
result[property] = asNumber(value);
|
|
2539
2960
|
}
|
|
2540
2961
|
}
|
|
@@ -2622,7 +3043,10 @@ function commit_default() {
|
|
|
2622
3043
|
const task = rejectDeprecatedSignatures(message) || commitTask(
|
|
2623
3044
|
asArray(message),
|
|
2624
3045
|
asArray(filterType(rest[0], filterStringOrStringArray, [])),
|
|
2625
|
-
[
|
|
3046
|
+
[
|
|
3047
|
+
...asStringArray(filterType(rest[1], filterArray, [])),
|
|
3048
|
+
...getTrailingOptions(arguments, 0, true)
|
|
3049
|
+
]
|
|
2626
3050
|
);
|
|
2627
3051
|
return this._runTask(task, next);
|
|
2628
3052
|
}
|
|
@@ -2734,8 +3158,8 @@ var init_init = __esm({
|
|
|
2734
3158
|
}
|
|
2735
3159
|
});
|
|
2736
3160
|
function logFormatFromCommand(customArgs) {
|
|
2737
|
-
for (let
|
|
2738
|
-
const format = logFormatRegex.exec(customArgs[
|
|
3161
|
+
for (let i2 = 0; i2 < customArgs.length; i2++) {
|
|
3162
|
+
const format = logFormatRegex.exec(customArgs[i2]);
|
|
2739
3163
|
if (format) {
|
|
2740
3164
|
return `--${format[1]}`;
|
|
2741
3165
|
}
|
|
@@ -2863,7 +3287,7 @@ var init_parse_diff_summary = __esm({
|
|
|
2863
3287
|
(result, [status, similarity, from, _to, to]) => {
|
|
2864
3288
|
result.changed++;
|
|
2865
3289
|
result.files.push({
|
|
2866
|
-
file: to
|
|
3290
|
+
file: to ?? from,
|
|
2867
3291
|
changes: 0,
|
|
2868
3292
|
insertions: 0,
|
|
2869
3293
|
deletions: 0,
|
|
@@ -3005,7 +3429,7 @@ function userOptions(input) {
|
|
|
3005
3429
|
}
|
|
3006
3430
|
function parseLogOptions(opt = {}, customArgs = []) {
|
|
3007
3431
|
const splitter = filterType(opt.splitter, filterString, SPLITTER);
|
|
3008
|
-
const format =
|
|
3432
|
+
const format = filterPlainObject(opt.format) ? opt.format : {
|
|
3009
3433
|
hash: "%H",
|
|
3010
3434
|
date: opt.strictDate === false ? "%ai" : "%aI",
|
|
3011
3435
|
message: "%s",
|
|
@@ -3029,7 +3453,7 @@ function parseLogOptions(opt = {}, customArgs = []) {
|
|
|
3029
3453
|
suffix.push(`${opt.from || ""}${rangeOperator}${opt.to || ""}`);
|
|
3030
3454
|
}
|
|
3031
3455
|
if (filterString(opt.file)) {
|
|
3032
|
-
command.push("--follow",
|
|
3456
|
+
command.push("--follow", c(opt.file));
|
|
3033
3457
|
}
|
|
3034
3458
|
appendTaskOptions(userOptions(opt), command);
|
|
3035
3459
|
return {
|
|
@@ -3052,7 +3476,7 @@ function log_default() {
|
|
|
3052
3476
|
const next = trailingFunctionArgument(arguments);
|
|
3053
3477
|
const options = parseLogOptions(
|
|
3054
3478
|
trailingOptionsArgument(arguments),
|
|
3055
|
-
filterType(arguments[0], filterArray)
|
|
3479
|
+
asStringArray(filterType(arguments[0], filterArray, []))
|
|
3056
3480
|
);
|
|
3057
3481
|
const task = rejectDeprecatedSignatures(...rest) || validateLogFormatConfig(options.commands) || createLogTask(options);
|
|
3058
3482
|
return this._runTask(task, next);
|
|
@@ -3072,7 +3496,6 @@ var init_log = __esm({
|
|
|
3072
3496
|
"src/lib/tasks/log.ts"() {
|
|
3073
3497
|
"use strict";
|
|
3074
3498
|
init_log_format();
|
|
3075
|
-
init_pathspec();
|
|
3076
3499
|
init_parse_list_log_summary();
|
|
3077
3500
|
init_utils();
|
|
3078
3501
|
init_task();
|
|
@@ -3421,9 +3844,10 @@ var init_parse_push = __esm({
|
|
|
3421
3844
|
result.repo = repo;
|
|
3422
3845
|
}),
|
|
3423
3846
|
new LineParser(/^updating local tracking ref '(.+)'/, (result, [local]) => {
|
|
3424
|
-
result.ref =
|
|
3847
|
+
result.ref = {
|
|
3848
|
+
...result.ref || {},
|
|
3425
3849
|
local
|
|
3426
|
-
}
|
|
3850
|
+
};
|
|
3427
3851
|
}),
|
|
3428
3852
|
new LineParser(/^[=*-]\s+([^:]+):(\S+)\s+\[(.+)]$/, (result, [local, remote, type]) => {
|
|
3429
3853
|
result.pushed.push(pushResultPushedItem(local, remote, type));
|
|
@@ -3431,11 +3855,12 @@ var init_parse_push = __esm({
|
|
|
3431
3855
|
new LineParser(
|
|
3432
3856
|
/^Branch '([^']+)' set up to track remote branch '([^']+)' from '([^']+)'/,
|
|
3433
3857
|
(result, [local, remote, remoteName]) => {
|
|
3434
|
-
result.branch =
|
|
3858
|
+
result.branch = {
|
|
3859
|
+
...result.branch || {},
|
|
3435
3860
|
local,
|
|
3436
3861
|
remote,
|
|
3437
3862
|
remoteName
|
|
3438
|
-
}
|
|
3863
|
+
};
|
|
3439
3864
|
}
|
|
3440
3865
|
),
|
|
3441
3866
|
new LineParser(
|
|
@@ -3457,7 +3882,10 @@ var init_parse_push = __esm({
|
|
|
3457
3882
|
parsePushResult = (stdOut, stdErr) => {
|
|
3458
3883
|
const pushDetail = parsePushDetail(stdOut, stdErr);
|
|
3459
3884
|
const responseDetail = parseRemoteMessages(stdOut, stdErr);
|
|
3460
|
-
return
|
|
3885
|
+
return {
|
|
3886
|
+
...pushDetail,
|
|
3887
|
+
...responseDetail
|
|
3888
|
+
};
|
|
3461
3889
|
};
|
|
3462
3890
|
parsePushDetail = (stdOut, stdErr) => {
|
|
3463
3891
|
return parseStringResponse({ pushed: [] }, parsers5, [stdOut, stdErr]);
|
|
@@ -3556,15 +3984,15 @@ function parser3(indexX, indexY, handler) {
|
|
|
3556
3984
|
return [`${indexX}${indexY}`, handler];
|
|
3557
3985
|
}
|
|
3558
3986
|
function conflicts(indexX, ...indexY) {
|
|
3559
|
-
return indexY.map((
|
|
3987
|
+
return indexY.map((y2) => parser3(indexX, y2, (result, file) => result.conflicted.push(file)));
|
|
3560
3988
|
}
|
|
3561
3989
|
function splitLine(result, lineStr) {
|
|
3562
3990
|
const trimmed2 = lineStr.trim();
|
|
3563
3991
|
switch (" ") {
|
|
3564
3992
|
case trimmed2.charAt(2):
|
|
3565
|
-
return data(trimmed2.charAt(0), trimmed2.charAt(1), trimmed2.
|
|
3993
|
+
return data(trimmed2.charAt(0), trimmed2.charAt(1), trimmed2.slice(3));
|
|
3566
3994
|
case trimmed2.charAt(1):
|
|
3567
|
-
return data(" ", trimmed2.charAt(0), trimmed2.
|
|
3995
|
+
return data(" ", trimmed2.charAt(0), trimmed2.slice(2));
|
|
3568
3996
|
default:
|
|
3569
3997
|
return;
|
|
3570
3998
|
}
|
|
@@ -3612,58 +4040,54 @@ var init_StatusSummary = __esm({
|
|
|
3612
4040
|
parser3(
|
|
3613
4041
|
" ",
|
|
3614
4042
|
"A",
|
|
3615
|
-
(result, file) =>
|
|
4043
|
+
(result, file) => result.created.push(file)
|
|
3616
4044
|
),
|
|
3617
4045
|
parser3(
|
|
3618
4046
|
" ",
|
|
3619
4047
|
"D",
|
|
3620
|
-
(result, file) =>
|
|
3621
|
-
),
|
|
3622
|
-
parser3(
|
|
3623
|
-
" ",
|
|
3624
|
-
"M",
|
|
3625
|
-
(result, file) => append(result.modified, file)
|
|
3626
|
-
),
|
|
3627
|
-
parser3(
|
|
3628
|
-
"A",
|
|
3629
|
-
" ",
|
|
3630
|
-
(result, file) => append(result.created, file) && append(result.staged, file)
|
|
3631
|
-
),
|
|
3632
|
-
parser3(
|
|
3633
|
-
"A",
|
|
3634
|
-
"M",
|
|
3635
|
-
(result, file) => append(result.created, file) && append(result.staged, file) && append(result.modified, file)
|
|
3636
|
-
),
|
|
3637
|
-
parser3(
|
|
3638
|
-
"D",
|
|
3639
|
-
" ",
|
|
3640
|
-
(result, file) => append(result.deleted, file) && append(result.staged, file)
|
|
4048
|
+
(result, file) => result.deleted.push(file)
|
|
3641
4049
|
),
|
|
3642
4050
|
parser3(
|
|
3643
|
-
"M",
|
|
3644
4051
|
" ",
|
|
3645
|
-
(result, file) => append(result.modified, file) && append(result.staged, file)
|
|
3646
|
-
),
|
|
3647
|
-
parser3(
|
|
3648
|
-
"M",
|
|
3649
4052
|
"M",
|
|
3650
|
-
(result, file) =>
|
|
4053
|
+
(result, file) => result.modified.push(file)
|
|
3651
4054
|
),
|
|
4055
|
+
parser3("A", " ", (result, file) => {
|
|
4056
|
+
result.created.push(file);
|
|
4057
|
+
result.staged.push(file);
|
|
4058
|
+
}),
|
|
4059
|
+
parser3("A", "M", (result, file) => {
|
|
4060
|
+
result.created.push(file);
|
|
4061
|
+
result.staged.push(file);
|
|
4062
|
+
result.modified.push(file);
|
|
4063
|
+
}),
|
|
4064
|
+
parser3("D", " ", (result, file) => {
|
|
4065
|
+
result.deleted.push(file);
|
|
4066
|
+
result.staged.push(file);
|
|
4067
|
+
}),
|
|
4068
|
+
parser3("M", " ", (result, file) => {
|
|
4069
|
+
result.modified.push(file);
|
|
4070
|
+
result.staged.push(file);
|
|
4071
|
+
}),
|
|
4072
|
+
parser3("M", "M", (result, file) => {
|
|
4073
|
+
result.modified.push(file);
|
|
4074
|
+
result.staged.push(file);
|
|
4075
|
+
}),
|
|
3652
4076
|
parser3("R", " ", (result, file) => {
|
|
3653
|
-
|
|
4077
|
+
result.renamed.push(renamedFile(file));
|
|
3654
4078
|
}),
|
|
3655
4079
|
parser3("R", "M", (result, file) => {
|
|
3656
4080
|
const renamed = renamedFile(file);
|
|
3657
|
-
|
|
3658
|
-
|
|
4081
|
+
result.renamed.push(renamed);
|
|
4082
|
+
result.modified.push(renamed.to);
|
|
3659
4083
|
}),
|
|
3660
4084
|
parser3("!", "!", (_result, _file) => {
|
|
3661
|
-
|
|
4085
|
+
(_result.ignored = _result.ignored || []).push(_file);
|
|
3662
4086
|
}),
|
|
3663
4087
|
parser3(
|
|
3664
4088
|
"?",
|
|
3665
4089
|
"?",
|
|
3666
|
-
(result, file) =>
|
|
4090
|
+
(result, file) => result.not_added.push(file)
|
|
3667
4091
|
),
|
|
3668
4092
|
...conflicts(
|
|
3669
4093
|
"A",
|
|
@@ -3691,18 +4115,19 @@ var init_StatusSummary = __esm({
|
|
|
3691
4115
|
const behindReg = /behind (\d+)/;
|
|
3692
4116
|
const currentReg = /^(.+?(?=(?:\.{3}|\s|$)))/;
|
|
3693
4117
|
const trackingReg = /\.{3}(\S*)/;
|
|
3694
|
-
const onEmptyBranchReg = /\son\s(
|
|
3695
|
-
let regexResult;
|
|
3696
|
-
regexResult = aheadReg.exec(line);
|
|
4118
|
+
const onEmptyBranchReg = /\son\s(\S+?)(?=\.{3}|$)/;
|
|
4119
|
+
let regexResult = aheadReg.exec(line);
|
|
3697
4120
|
result.ahead = regexResult && +regexResult[1] || 0;
|
|
3698
4121
|
regexResult = behindReg.exec(line);
|
|
3699
4122
|
result.behind = regexResult && +regexResult[1] || 0;
|
|
3700
4123
|
regexResult = currentReg.exec(line);
|
|
3701
|
-
result.current = regexResult
|
|
4124
|
+
result.current = filterType(regexResult == null ? void 0 : regexResult[1], filterString, null);
|
|
3702
4125
|
regexResult = trackingReg.exec(line);
|
|
3703
|
-
result.tracking = regexResult
|
|
4126
|
+
result.tracking = filterType(regexResult == null ? void 0 : regexResult[1], filterString, null);
|
|
3704
4127
|
regexResult = onEmptyBranchReg.exec(line);
|
|
3705
|
-
|
|
4128
|
+
if (regexResult) {
|
|
4129
|
+
result.current = filterType(regexResult == null ? void 0 : regexResult[1], filterString, result.current);
|
|
4130
|
+
}
|
|
3706
4131
|
result.detached = /\(no branch\)/.test(line);
|
|
3707
4132
|
}
|
|
3708
4133
|
]
|
|
@@ -3710,13 +4135,13 @@ var init_StatusSummary = __esm({
|
|
|
3710
4135
|
parseStatusSummary = function(text) {
|
|
3711
4136
|
const lines = text.split(NULL);
|
|
3712
4137
|
const status = new StatusSummary();
|
|
3713
|
-
for (let
|
|
3714
|
-
let line = lines[
|
|
4138
|
+
for (let i2 = 0, l = lines.length; i2 < l; ) {
|
|
4139
|
+
let line = lines[i2++].trim();
|
|
3715
4140
|
if (!line) {
|
|
3716
4141
|
continue;
|
|
3717
4142
|
}
|
|
3718
4143
|
if (line.charAt(0) === "R") {
|
|
3719
|
-
line += NULL + (lines[
|
|
4144
|
+
line += NULL + (lines[i2++] || "");
|
|
3720
4145
|
}
|
|
3721
4146
|
splitLine(status, line);
|
|
3722
4147
|
}
|
|
@@ -3820,6 +4245,47 @@ var init_version = __esm({
|
|
|
3820
4245
|
];
|
|
3821
4246
|
}
|
|
3822
4247
|
});
|
|
4248
|
+
function createCloneTask(api, task, repoPath, ...args) {
|
|
4249
|
+
if (!filterString(repoPath)) {
|
|
4250
|
+
return configurationErrorTask(`git.${api}() requires a string 'repoPath'`);
|
|
4251
|
+
}
|
|
4252
|
+
return task(repoPath, filterType(args[0], filterString), getTrailingOptions(arguments));
|
|
4253
|
+
}
|
|
4254
|
+
function clone_default() {
|
|
4255
|
+
return {
|
|
4256
|
+
clone(repo, ...rest) {
|
|
4257
|
+
return this._runTask(
|
|
4258
|
+
createCloneTask("clone", cloneTask, filterType(repo, filterString), ...rest),
|
|
4259
|
+
trailingFunctionArgument(arguments)
|
|
4260
|
+
);
|
|
4261
|
+
},
|
|
4262
|
+
mirror(repo, ...rest) {
|
|
4263
|
+
return this._runTask(
|
|
4264
|
+
createCloneTask("mirror", cloneMirrorTask, filterType(repo, filterString), ...rest),
|
|
4265
|
+
trailingFunctionArgument(arguments)
|
|
4266
|
+
);
|
|
4267
|
+
}
|
|
4268
|
+
};
|
|
4269
|
+
}
|
|
4270
|
+
var cloneTask;
|
|
4271
|
+
var cloneMirrorTask;
|
|
4272
|
+
var init_clone = __esm({
|
|
4273
|
+
"src/lib/tasks/clone.ts"() {
|
|
4274
|
+
"use strict";
|
|
4275
|
+
init_task();
|
|
4276
|
+
init_utils();
|
|
4277
|
+
cloneTask = (repo, directory, customArgs) => {
|
|
4278
|
+
const commands = ["clone", ...customArgs];
|
|
4279
|
+
filterString(repo) && commands.push(c(repo));
|
|
4280
|
+
filterString(directory) && commands.push(c(directory));
|
|
4281
|
+
return straightThroughStringTask(commands);
|
|
4282
|
+
};
|
|
4283
|
+
cloneMirrorTask = (repo, directory, customArgs) => {
|
|
4284
|
+
append(customArgs, "--mirror");
|
|
4285
|
+
return cloneTask(repo, directory, customArgs);
|
|
4286
|
+
};
|
|
4287
|
+
}
|
|
4288
|
+
});
|
|
3823
4289
|
var simple_git_api_exports = {};
|
|
3824
4290
|
__export2(simple_git_api_exports, {
|
|
3825
4291
|
SimpleGitApi: () => SimpleGitApi
|
|
@@ -3846,6 +4312,7 @@ var init_simple_git_api = __esm({
|
|
|
3846
4312
|
init_task();
|
|
3847
4313
|
init_version();
|
|
3848
4314
|
init_utils();
|
|
4315
|
+
init_clone();
|
|
3849
4316
|
SimpleGitApi = class {
|
|
3850
4317
|
constructor(_executor) {
|
|
3851
4318
|
this._executor = _executor;
|
|
@@ -3948,6 +4415,7 @@ var init_simple_git_api = __esm({
|
|
|
3948
4415
|
Object.assign(
|
|
3949
4416
|
SimpleGitApi.prototype,
|
|
3950
4417
|
checkout_default(),
|
|
4418
|
+
clone_default(),
|
|
3951
4419
|
commit_default(),
|
|
3952
4420
|
config_default(),
|
|
3953
4421
|
count_objects_default(),
|
|
@@ -4123,10 +4591,15 @@ var init_BranchSummary = __esm({
|
|
|
4123
4591
|
function branchStatus(input) {
|
|
4124
4592
|
return input ? input.charAt(0) : "";
|
|
4125
4593
|
}
|
|
4126
|
-
function parseBranchSummary(stdOut) {
|
|
4127
|
-
return parseStringResponse(
|
|
4594
|
+
function parseBranchSummary(stdOut, currentOnly = false) {
|
|
4595
|
+
return parseStringResponse(
|
|
4596
|
+
new BranchSummaryResult(),
|
|
4597
|
+
currentOnly ? [currentBranchParser] : parsers9,
|
|
4598
|
+
stdOut
|
|
4599
|
+
);
|
|
4128
4600
|
}
|
|
4129
4601
|
var parsers9;
|
|
4602
|
+
var currentBranchParser;
|
|
4130
4603
|
var init_parse_branch = __esm({
|
|
4131
4604
|
"src/lib/parsers/parse-branch.ts"() {
|
|
4132
4605
|
"use strict";
|
|
@@ -4140,12 +4613,15 @@ var init_parse_branch = __esm({
|
|
|
4140
4613
|
}
|
|
4141
4614
|
),
|
|
4142
4615
|
new LineParser(
|
|
4143
|
-
|
|
4616
|
+
/^([*+]\s)?(\S+)\s+([a-z0-9]+)\s?(.*)$/s,
|
|
4144
4617
|
(result, [current, name, commit, label]) => {
|
|
4145
4618
|
result.push(branchStatus(current), false, name, commit, label);
|
|
4146
4619
|
}
|
|
4147
4620
|
)
|
|
4148
4621
|
];
|
|
4622
|
+
currentBranchParser = new LineParser(/^(\S+)$/s, (result, [name]) => {
|
|
4623
|
+
result.push("*", false, name, "", "");
|
|
4624
|
+
});
|
|
4149
4625
|
}
|
|
4150
4626
|
});
|
|
4151
4627
|
var branch_exports = {};
|
|
@@ -4162,6 +4638,7 @@ function containsDeleteBranchCommand(commands) {
|
|
|
4162
4638
|
}
|
|
4163
4639
|
function branchTask(customArgs) {
|
|
4164
4640
|
const isDelete = containsDeleteBranchCommand(customArgs);
|
|
4641
|
+
const isCurrentOnly = customArgs.includes("--show-current");
|
|
4165
4642
|
const commands = ["branch", ...customArgs];
|
|
4166
4643
|
if (commands.length === 1) {
|
|
4167
4644
|
commands.push("-a");
|
|
@@ -4176,16 +4653,17 @@ function branchTask(customArgs) {
|
|
|
4176
4653
|
if (isDelete) {
|
|
4177
4654
|
return parseBranchDeletions(stdOut, stdErr).all[0];
|
|
4178
4655
|
}
|
|
4179
|
-
return parseBranchSummary(stdOut);
|
|
4656
|
+
return parseBranchSummary(stdOut, isCurrentOnly);
|
|
4180
4657
|
}
|
|
4181
4658
|
};
|
|
4182
4659
|
}
|
|
4183
4660
|
function branchLocalTask() {
|
|
4184
|
-
const parser4 = parseBranchSummary;
|
|
4185
4661
|
return {
|
|
4186
4662
|
format: "utf-8",
|
|
4187
4663
|
commands: ["branch", "-v"],
|
|
4188
|
-
parser
|
|
4664
|
+
parser(stdOut) {
|
|
4665
|
+
return parseBranchSummary(stdOut);
|
|
4666
|
+
}
|
|
4189
4667
|
};
|
|
4190
4668
|
}
|
|
4191
4669
|
function deleteBranchesTask(branches, forceDelete = false) {
|
|
@@ -4210,7 +4688,7 @@ function deleteBranchTask(branch, forceDelete = false) {
|
|
|
4210
4688
|
parser(stdOut, stdErr) {
|
|
4211
4689
|
return parseBranchDeletions(stdOut, stdErr).branches[branch];
|
|
4212
4690
|
},
|
|
4213
|
-
onError({ exitCode, stdErr, stdOut }, error,
|
|
4691
|
+
onError({ exitCode, stdErr, stdOut }, error, _2, fail) {
|
|
4214
4692
|
if (!hasBranchDeletionError(String(error), exitCode)) {
|
|
4215
4693
|
return fail(error);
|
|
4216
4694
|
}
|
|
@@ -4231,12 +4709,16 @@ var init_branch = __esm({
|
|
|
4231
4709
|
init_utils();
|
|
4232
4710
|
}
|
|
4233
4711
|
});
|
|
4712
|
+
function toPath(input) {
|
|
4713
|
+
const path2 = input.trim().replace(/^["']|["']$/g, "");
|
|
4714
|
+
return path2 && (0, import_node_path.normalize)(path2);
|
|
4715
|
+
}
|
|
4234
4716
|
var parseCheckIgnore;
|
|
4235
4717
|
var init_CheckIgnore = __esm({
|
|
4236
4718
|
"src/lib/responses/CheckIgnore.ts"() {
|
|
4237
4719
|
"use strict";
|
|
4238
4720
|
parseCheckIgnore = (text) => {
|
|
4239
|
-
return text.split(/\n/g).map(
|
|
4721
|
+
return text.split(/\n/g).map(toPath).filter(Boolean);
|
|
4240
4722
|
};
|
|
4241
4723
|
}
|
|
4242
4724
|
});
|
|
@@ -4257,35 +4739,6 @@ var init_check_ignore = __esm({
|
|
|
4257
4739
|
init_CheckIgnore();
|
|
4258
4740
|
}
|
|
4259
4741
|
});
|
|
4260
|
-
var clone_exports = {};
|
|
4261
|
-
__export2(clone_exports, {
|
|
4262
|
-
cloneMirrorTask: () => cloneMirrorTask,
|
|
4263
|
-
cloneTask: () => cloneTask
|
|
4264
|
-
});
|
|
4265
|
-
function disallowedCommand(command) {
|
|
4266
|
-
return /^--upload-pack(=|$)/.test(command);
|
|
4267
|
-
}
|
|
4268
|
-
function cloneTask(repo, directory, customArgs) {
|
|
4269
|
-
const commands = ["clone", ...customArgs];
|
|
4270
|
-
filterString(repo) && commands.push(repo);
|
|
4271
|
-
filterString(directory) && commands.push(directory);
|
|
4272
|
-
const banned = commands.find(disallowedCommand);
|
|
4273
|
-
if (banned) {
|
|
4274
|
-
return configurationErrorTask(`git.fetch: potential exploit argument blocked.`);
|
|
4275
|
-
}
|
|
4276
|
-
return straightThroughStringTask(commands);
|
|
4277
|
-
}
|
|
4278
|
-
function cloneMirrorTask(repo, directory, customArgs) {
|
|
4279
|
-
append(customArgs, "--mirror");
|
|
4280
|
-
return cloneTask(repo, directory, customArgs);
|
|
4281
|
-
}
|
|
4282
|
-
var init_clone = __esm({
|
|
4283
|
-
"src/lib/tasks/clone.ts"() {
|
|
4284
|
-
"use strict";
|
|
4285
|
-
init_task();
|
|
4286
|
-
init_utils();
|
|
4287
|
-
}
|
|
4288
|
-
});
|
|
4289
4742
|
function parseFetchResult(stdOut, stdErr) {
|
|
4290
4743
|
const result = {
|
|
4291
4744
|
raw: stdOut,
|
|
@@ -4341,7 +4794,7 @@ var fetch_exports = {};
|
|
|
4341
4794
|
__export2(fetch_exports, {
|
|
4342
4795
|
fetchTask: () => fetchTask
|
|
4343
4796
|
});
|
|
4344
|
-
function
|
|
4797
|
+
function disallowedCommand(command) {
|
|
4345
4798
|
return /^--upload-pack(=|$)/.test(command);
|
|
4346
4799
|
}
|
|
4347
4800
|
function fetchTask(remote, branch, customArgs) {
|
|
@@ -4349,7 +4802,7 @@ function fetchTask(remote, branch, customArgs) {
|
|
|
4349
4802
|
if (remote && branch) {
|
|
4350
4803
|
commands.push(remote, branch);
|
|
4351
4804
|
}
|
|
4352
|
-
const banned = commands.find(
|
|
4805
|
+
const banned = commands.find(disallowedCommand);
|
|
4353
4806
|
if (banned) {
|
|
4354
4807
|
return configurationErrorTask(`git.fetch: potential exploit argument blocked.`);
|
|
4355
4808
|
}
|
|
@@ -4442,7 +4895,7 @@ function parseGetRemotes(text) {
|
|
|
4442
4895
|
function parseGetRemotesVerbose(text) {
|
|
4443
4896
|
const remotes = {};
|
|
4444
4897
|
forEach(text, ([name, url, purpose]) => {
|
|
4445
|
-
if (!
|
|
4898
|
+
if (!Object.hasOwn(remotes, name)) {
|
|
4446
4899
|
remotes[name] = {
|
|
4447
4900
|
name,
|
|
4448
4901
|
refs: { fetch: "", push: "" }
|
|
@@ -4565,16 +5018,16 @@ var init_sub_module = __esm({
|
|
|
4565
5018
|
init_task();
|
|
4566
5019
|
}
|
|
4567
5020
|
});
|
|
4568
|
-
function singleSorted(a,
|
|
4569
|
-
const aIsNum = isNaN(a);
|
|
4570
|
-
const bIsNum = isNaN(
|
|
5021
|
+
function singleSorted(a, b2) {
|
|
5022
|
+
const aIsNum = Number.isNaN(a);
|
|
5023
|
+
const bIsNum = Number.isNaN(b2);
|
|
4571
5024
|
if (aIsNum !== bIsNum) {
|
|
4572
5025
|
return aIsNum ? 1 : -1;
|
|
4573
5026
|
}
|
|
4574
|
-
return aIsNum ? sorted(a,
|
|
5027
|
+
return aIsNum ? sorted(a, b2) : 0;
|
|
4575
5028
|
}
|
|
4576
|
-
function sorted(a,
|
|
4577
|
-
return a ===
|
|
5029
|
+
function sorted(a, b2) {
|
|
5030
|
+
return a === b2 ? 0 : a > b2 ? 1 : -1;
|
|
4578
5031
|
}
|
|
4579
5032
|
function trimmed(input) {
|
|
4580
5033
|
return input.trim();
|
|
@@ -4605,8 +5058,8 @@ var init_TagList = __esm({
|
|
|
4605
5058
|
if (partsA.length === 1 || partsB.length === 1) {
|
|
4606
5059
|
return singleSorted(toNumber(partsA[0]), toNumber(partsB[0]));
|
|
4607
5060
|
}
|
|
4608
|
-
for (let
|
|
4609
|
-
const diff = sorted(toNumber(partsA[
|
|
5061
|
+
for (let i2 = 0, l = Math.max(partsA.length, partsB.length); i2 < l; i2++) {
|
|
5062
|
+
const diff = sorted(toNumber(partsA[i2]), toNumber(partsB[i2]));
|
|
4610
5063
|
if (diff) {
|
|
4611
5064
|
return diff;
|
|
4612
5065
|
}
|
|
@@ -4665,7 +5118,7 @@ var require_git = __commonJS2({
|
|
|
4665
5118
|
var { GitExecutor: GitExecutor2 } = (init_git_executor(), __toCommonJS2(git_executor_exports));
|
|
4666
5119
|
var { SimpleGitApi: SimpleGitApi2 } = (init_simple_git_api(), __toCommonJS2(simple_git_api_exports));
|
|
4667
5120
|
var { Scheduler: Scheduler2 } = (init_scheduler(), __toCommonJS2(scheduler_exports));
|
|
4668
|
-
var { configurationErrorTask: configurationErrorTask2 } = (init_task(), __toCommonJS2(task_exports));
|
|
5121
|
+
var { adhocExecTask: adhocExecTask2, configurationErrorTask: configurationErrorTask2 } = (init_task(), __toCommonJS2(task_exports));
|
|
4669
5122
|
var {
|
|
4670
5123
|
asArray: asArray2,
|
|
4671
5124
|
filterArray: filterArray2,
|
|
@@ -4686,7 +5139,6 @@ var require_git = __commonJS2({
|
|
|
4686
5139
|
} = (init_branch(), __toCommonJS2(branch_exports));
|
|
4687
5140
|
var { checkIgnoreTask: checkIgnoreTask2 } = (init_check_ignore(), __toCommonJS2(check_ignore_exports));
|
|
4688
5141
|
var { checkIsRepoTask: checkIsRepoTask2 } = (init_check_is_repo(), __toCommonJS2(check_is_repo_exports));
|
|
4689
|
-
var { cloneTask: cloneTask2, cloneMirrorTask: cloneMirrorTask2 } = (init_clone(), __toCommonJS2(clone_exports));
|
|
4690
5142
|
var { cleanWithOptionsTask: cleanWithOptionsTask2, isCleanOptionsArray: isCleanOptionsArray2 } = (init_clean(), __toCommonJS2(clean_exports));
|
|
4691
5143
|
var { diffSummaryTask: diffSummaryTask2 } = (init_diff(), __toCommonJS2(diff_exports));
|
|
4692
5144
|
var { fetchTask: fetchTask2 } = (init_fetch(), __toCommonJS2(fetch_exports));
|
|
@@ -4741,24 +5193,6 @@ var require_git = __commonJS2({
|
|
|
4741
5193
|
trailingFunctionArgument2(arguments)
|
|
4742
5194
|
);
|
|
4743
5195
|
};
|
|
4744
|
-
function createCloneTask(api, task, repoPath, localPath) {
|
|
4745
|
-
if (typeof repoPath !== "string") {
|
|
4746
|
-
return configurationErrorTask2(`git.${api}() requires a string 'repoPath'`);
|
|
4747
|
-
}
|
|
4748
|
-
return task(repoPath, filterType2(localPath, filterString2), getTrailingOptions2(arguments));
|
|
4749
|
-
}
|
|
4750
|
-
Git2.prototype.clone = function() {
|
|
4751
|
-
return this._runTask(
|
|
4752
|
-
createCloneTask("clone", cloneTask2, ...arguments),
|
|
4753
|
-
trailingFunctionArgument2(arguments)
|
|
4754
|
-
);
|
|
4755
|
-
};
|
|
4756
|
-
Git2.prototype.mirror = function() {
|
|
4757
|
-
return this._runTask(
|
|
4758
|
-
createCloneTask("mirror", cloneMirrorTask2, ...arguments),
|
|
4759
|
-
trailingFunctionArgument2(arguments)
|
|
4760
|
-
);
|
|
4761
|
-
};
|
|
4762
5196
|
Git2.prototype.mv = function(from, to) {
|
|
4763
5197
|
return this._runTask(moveTask2(from, to), trailingFunctionArgument2(arguments));
|
|
4764
5198
|
};
|
|
@@ -4791,10 +5225,13 @@ var require_git = __commonJS2({
|
|
|
4791
5225
|
);
|
|
4792
5226
|
};
|
|
4793
5227
|
Git2.prototype.silent = function(silence) {
|
|
4794
|
-
|
|
4795
|
-
|
|
5228
|
+
return this._runTask(
|
|
5229
|
+
adhocExecTask2(
|
|
5230
|
+
() => console.warn(
|
|
5231
|
+
"simple-git deprecation notice: git.silent: logging should be configured using the `debug` library / `DEBUG` environment variable, this method will be removed."
|
|
5232
|
+
)
|
|
5233
|
+
)
|
|
4796
5234
|
);
|
|
4797
|
-
return this;
|
|
4798
5235
|
};
|
|
4799
5236
|
Git2.prototype.tags = function(options, then) {
|
|
4800
5237
|
return this._runTask(
|
|
@@ -4858,9 +5295,9 @@ var require_git = __commonJS2({
|
|
|
4858
5295
|
Git2.prototype.raw = function(commands) {
|
|
4859
5296
|
const createRestCommands = !Array.isArray(commands);
|
|
4860
5297
|
const command = [].slice.call(createRestCommands ? arguments : commands, 0);
|
|
4861
|
-
for (let
|
|
4862
|
-
if (!filterPrimitives2(command[
|
|
4863
|
-
command.splice(
|
|
5298
|
+
for (let i2 = 0; i2 < command.length && createRestCommands; i2++) {
|
|
5299
|
+
if (!filterPrimitives2(command[i2])) {
|
|
5300
|
+
command.splice(i2, command.length - i2);
|
|
4864
5301
|
break;
|
|
4865
5302
|
}
|
|
4866
5303
|
}
|
|
@@ -5020,7 +5457,13 @@ var require_git = __commonJS2({
|
|
|
5020
5457
|
return this._runTask(task);
|
|
5021
5458
|
};
|
|
5022
5459
|
Git2.prototype.clearQueue = function() {
|
|
5023
|
-
return this
|
|
5460
|
+
return this._runTask(
|
|
5461
|
+
adhocExecTask2(
|
|
5462
|
+
() => console.warn(
|
|
5463
|
+
"simple-git deprecation notice: clearQueue() is deprecated and will be removed, switch to using the abortPlugin instead."
|
|
5464
|
+
)
|
|
5465
|
+
)
|
|
5466
|
+
);
|
|
5024
5467
|
};
|
|
5025
5468
|
Git2.prototype.checkIgnore = function(pathnames, then) {
|
|
5026
5469
|
return this._runTask(
|
|
@@ -5037,7 +5480,6 @@ var require_git = __commonJS2({
|
|
|
5037
5480
|
module2.exports = Git2;
|
|
5038
5481
|
}
|
|
5039
5482
|
});
|
|
5040
|
-
init_pathspec();
|
|
5041
5483
|
init_git_error();
|
|
5042
5484
|
var GitConstructError = class extends GitError {
|
|
5043
5485
|
constructor(config, message) {
|
|
@@ -5087,57 +5529,15 @@ function abortPlugin(signal) {
|
|
|
5087
5529
|
};
|
|
5088
5530
|
return [onSpawnBefore, onSpawnAfter];
|
|
5089
5531
|
}
|
|
5090
|
-
function
|
|
5091
|
-
return typeof arg === "string" && arg.trim().toLowerCase() === "-c";
|
|
5092
|
-
}
|
|
5093
|
-
function preventProtocolOverride(arg, next) {
|
|
5094
|
-
if (!isConfigSwitch(arg)) {
|
|
5095
|
-
return;
|
|
5096
|
-
}
|
|
5097
|
-
if (!/^\s*protocol(.[a-z]+)?.allow/.test(next)) {
|
|
5098
|
-
return;
|
|
5099
|
-
}
|
|
5100
|
-
throw new GitPluginError(
|
|
5101
|
-
void 0,
|
|
5102
|
-
"unsafe",
|
|
5103
|
-
"Configuring protocol.allow is not permitted without enabling allowUnsafeExtProtocol"
|
|
5104
|
-
);
|
|
5105
|
-
}
|
|
5106
|
-
function preventUploadPack(arg, method) {
|
|
5107
|
-
if (/^\s*--(upload|receive)-pack/.test(arg)) {
|
|
5108
|
-
throw new GitPluginError(
|
|
5109
|
-
void 0,
|
|
5110
|
-
"unsafe",
|
|
5111
|
-
`Use of --upload-pack or --receive-pack is not permitted without enabling allowUnsafePack`
|
|
5112
|
-
);
|
|
5113
|
-
}
|
|
5114
|
-
if (method === "clone" && /^\s*-u\b/.test(arg)) {
|
|
5115
|
-
throw new GitPluginError(
|
|
5116
|
-
void 0,
|
|
5117
|
-
"unsafe",
|
|
5118
|
-
`Use of clone with option -u is not permitted without enabling allowUnsafePack`
|
|
5119
|
-
);
|
|
5120
|
-
}
|
|
5121
|
-
if (method === "push" && /^\s*--exec\b/.test(arg)) {
|
|
5122
|
-
throw new GitPluginError(
|
|
5123
|
-
void 0,
|
|
5124
|
-
"unsafe",
|
|
5125
|
-
`Use of push with option --exec is not permitted without enabling allowUnsafePack`
|
|
5126
|
-
);
|
|
5127
|
-
}
|
|
5128
|
-
}
|
|
5129
|
-
function blockUnsafeOperationsPlugin({
|
|
5130
|
-
allowUnsafeProtocolOverride = false,
|
|
5131
|
-
allowUnsafePack = false
|
|
5132
|
-
} = {}) {
|
|
5532
|
+
function blockUnsafeOperationsPlugin(options = {}) {
|
|
5133
5533
|
return {
|
|
5134
5534
|
type: "spawn.args",
|
|
5135
|
-
action(args,
|
|
5136
|
-
|
|
5137
|
-
|
|
5138
|
-
|
|
5139
|
-
|
|
5140
|
-
}
|
|
5535
|
+
action(args, { env }) {
|
|
5536
|
+
for (const vulnerability of ne(args, env)) {
|
|
5537
|
+
if (options[vulnerability.category] !== true) {
|
|
5538
|
+
throw new GitPluginError(void 0, "unsafe", vulnerability.message);
|
|
5539
|
+
}
|
|
5540
|
+
}
|
|
5141
5541
|
return args;
|
|
5142
5542
|
}
|
|
5143
5543
|
};
|
|
@@ -5195,27 +5595,25 @@ function completionDetectionPlugin({
|
|
|
5195
5595
|
}
|
|
5196
5596
|
return {
|
|
5197
5597
|
type: "spawn.after",
|
|
5198
|
-
action(
|
|
5199
|
-
|
|
5200
|
-
|
|
5201
|
-
|
|
5202
|
-
|
|
5203
|
-
|
|
5204
|
-
|
|
5205
|
-
|
|
5206
|
-
|
|
5207
|
-
|
|
5208
|
-
|
|
5209
|
-
|
|
5210
|
-
|
|
5211
|
-
|
|
5212
|
-
yield delay(50);
|
|
5213
|
-
}
|
|
5214
|
-
close(events.exitCode);
|
|
5215
|
-
} catch (err) {
|
|
5216
|
-
close(events.exitCode, err);
|
|
5598
|
+
async action(_data, { spawned, close }) {
|
|
5599
|
+
var _a2, _b;
|
|
5600
|
+
const events = createEvents();
|
|
5601
|
+
let deferClose = true;
|
|
5602
|
+
let quickClose = () => void (deferClose = false);
|
|
5603
|
+
(_a2 = spawned.stdout) == null ? void 0 : _a2.on("data", quickClose);
|
|
5604
|
+
(_b = spawned.stderr) == null ? void 0 : _b.on("data", quickClose);
|
|
5605
|
+
spawned.on("error", quickClose);
|
|
5606
|
+
spawned.on("close", (code) => events.close(code));
|
|
5607
|
+
spawned.on("exit", (code) => events.exit(code));
|
|
5608
|
+
try {
|
|
5609
|
+
await events.result;
|
|
5610
|
+
if (deferClose) {
|
|
5611
|
+
await delay(50);
|
|
5217
5612
|
}
|
|
5218
|
-
|
|
5613
|
+
close(events.exitCode);
|
|
5614
|
+
} catch (err) {
|
|
5615
|
+
close(events.exitCode, err);
|
|
5616
|
+
}
|
|
5219
5617
|
}
|
|
5220
5618
|
};
|
|
5221
5619
|
}
|
|
@@ -5223,7 +5621,7 @@ init_utils();
|
|
|
5223
5621
|
var WRONG_NUMBER_ERR = `Invalid value supplied for custom binary, requires a single string or an array containing either one or two strings`;
|
|
5224
5622
|
var WRONG_CHARS_ERR = `Invalid value supplied for custom binary, restricted characters must be removed or supply the unsafe.allowUnsafeCustomBinary option`;
|
|
5225
5623
|
function isBadArgument(arg) {
|
|
5226
|
-
return !arg || !/^([a-z]:)?([a-z0-9/.\\_
|
|
5624
|
+
return !arg || !/^([a-z]:)?([a-z0-9/.\\_~-]+)$/i.test(arg);
|
|
5227
5625
|
}
|
|
5228
5626
|
function toBinaryConfig(input, allowUnsafe) {
|
|
5229
5627
|
if (input.length < 1 || input.length > 2) {
|
|
@@ -5368,7 +5766,7 @@ function spawnOptionsPlugin(spawnOptions) {
|
|
|
5368
5766
|
return {
|
|
5369
5767
|
type: "spawn.options",
|
|
5370
5768
|
action(data) {
|
|
5371
|
-
return
|
|
5769
|
+
return { ...options, ...data };
|
|
5372
5770
|
}
|
|
5373
5771
|
};
|
|
5374
5772
|
}
|
|
@@ -5408,7 +5806,6 @@ function timeoutPlugin({
|
|
|
5408
5806
|
};
|
|
5409
5807
|
}
|
|
5410
5808
|
}
|
|
5411
|
-
init_pathspec();
|
|
5412
5809
|
function suffixPathsPlugin() {
|
|
5413
5810
|
return {
|
|
5414
5811
|
type: "spawn.args",
|
|
@@ -5418,15 +5815,15 @@ function suffixPathsPlugin() {
|
|
|
5418
5815
|
function append2(args) {
|
|
5419
5816
|
(suffix = suffix || []).push(...args);
|
|
5420
5817
|
}
|
|
5421
|
-
for (let
|
|
5422
|
-
const param = data[
|
|
5423
|
-
if (
|
|
5424
|
-
append2(
|
|
5818
|
+
for (let i2 = 0; i2 < data.length; i2++) {
|
|
5819
|
+
const param = data[i2];
|
|
5820
|
+
if (r(param)) {
|
|
5821
|
+
append2(o(param));
|
|
5425
5822
|
continue;
|
|
5426
5823
|
}
|
|
5427
5824
|
if (param === "--") {
|
|
5428
5825
|
append2(
|
|
5429
|
-
data.slice(
|
|
5826
|
+
data.slice(i2 + 1).flatMap((item) => r(item) && o(item) || item)
|
|
5430
5827
|
);
|
|
5431
5828
|
break;
|
|
5432
5829
|
}
|
|
@@ -5455,12 +5852,12 @@ function gitInstanceFactory(baseDir, options) {
|
|
|
5455
5852
|
plugins.add(commandConfigPrefixingPlugin(config.config));
|
|
5456
5853
|
}
|
|
5457
5854
|
plugins.add(blockUnsafeOperationsPlugin(config.unsafe));
|
|
5458
|
-
plugins.add(suffixPathsPlugin());
|
|
5459
5855
|
plugins.add(completionDetectionPlugin(config.completion));
|
|
5460
5856
|
config.abort && plugins.add(abortPlugin(config.abort));
|
|
5461
5857
|
config.progress && plugins.add(progressMonitorPlugin(config.progress));
|
|
5462
5858
|
config.timeout && plugins.add(timeoutPlugin(config.timeout));
|
|
5463
5859
|
config.spawnOptions && plugins.add(spawnOptionsPlugin(config.spawnOptions));
|
|
5860
|
+
plugins.add(suffixPathsPlugin());
|
|
5464
5861
|
plugins.add(errorDetectionPlugin(errorDetectionHandler(true)));
|
|
5465
5862
|
config.errors && plugins.add(errorDetectionPlugin(config.errors));
|
|
5466
5863
|
customBinaryPlugin(plugins, config.binary, (_a2 = config.unsafe) == null ? void 0 : _a2.allowUnsafeCustomBinary);
|
|
@@ -5474,11 +5871,11 @@ var import_crypto = require("crypto");
|
|
|
5474
5871
|
var import_fs = __toESM(require("fs"), 1);
|
|
5475
5872
|
var import_os = __toESM(require("os"), 1);
|
|
5476
5873
|
var import_fs2 = __toESM(require("fs"), 1);
|
|
5477
|
-
var __require = /* @__PURE__ */ ((
|
|
5478
|
-
get: (a,
|
|
5479
|
-
}) :
|
|
5874
|
+
var __require = /* @__PURE__ */ ((x2) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x2, {
|
|
5875
|
+
get: (a, b2) => (typeof require !== "undefined" ? require : a)[b2]
|
|
5876
|
+
}) : x2)(function(x2) {
|
|
5480
5877
|
if (typeof require !== "undefined") return require.apply(this, arguments);
|
|
5481
|
-
throw Error('Dynamic require of "' +
|
|
5878
|
+
throw Error('Dynamic require of "' + x2 + '" is not supported');
|
|
5482
5879
|
});
|
|
5483
5880
|
var _fetch = typeof globalThis.fetch !== "undefined" ? globalThis.fetch : __require("node-fetch");
|
|
5484
5881
|
var _AbortController = typeof globalThis.AbortController !== "undefined" ? globalThis.AbortController : __require("abort-controller").AbortController;
|
|
@@ -5555,8 +5952,8 @@ var SupatestApiClient = class {
|
|
|
5555
5952
|
if (this.options.dryRun) {
|
|
5556
5953
|
this.logPayload(`POST /v1/runs/${runId}/attachments/sign`, data);
|
|
5557
5954
|
return {
|
|
5558
|
-
uploads: data.attachments.map((att,
|
|
5559
|
-
attachmentId: `mock_att_${
|
|
5955
|
+
uploads: data.attachments.map((att, i2) => ({
|
|
5956
|
+
attachmentId: `mock_att_${i2}_${Date.now()}`,
|
|
5560
5957
|
signedUrl: `https://mock-s3.example.com/uploads/${att.filename}`,
|
|
5561
5958
|
expiresAt: new Date(Date.now() + 15 * 60 * 1e3).toISOString()
|
|
5562
5959
|
}))
|
|
@@ -5937,7 +6334,7 @@ function getBaseEnvironmentInfo() {
|
|
|
5937
6334
|
ci: getCIInfo()
|
|
5938
6335
|
};
|
|
5939
6336
|
}
|
|
5940
|
-
function registerInterruptHandler(client, getRunId) {
|
|
6337
|
+
function registerInterruptHandler(client, getRunId, getShard) {
|
|
5941
6338
|
let completed = false;
|
|
5942
6339
|
const handler = async (signal) => {
|
|
5943
6340
|
if (completed) {
|
|
@@ -5950,7 +6347,8 @@ function registerInterruptHandler(client, getRunId) {
|
|
|
5950
6347
|
try {
|
|
5951
6348
|
await client.completeRun(runId, {
|
|
5952
6349
|
status: "interrupted",
|
|
5953
|
-
endedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
6350
|
+
endedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
6351
|
+
shard: getShard == null ? void 0 : getShard()
|
|
5954
6352
|
});
|
|
5955
6353
|
} catch {
|
|
5956
6354
|
}
|
|
@@ -6133,6 +6531,8 @@ var SupatestCypressReporter = class {
|
|
|
6133
6531
|
projectId: options.projectId || process.env.SUPATEST_PROJECT_ID || "",
|
|
6134
6532
|
apiKey: options.apiKey || process.env.SUPATEST_API_KEY || "",
|
|
6135
6533
|
apiUrl: options.apiUrl || process.env.SUPATEST_API_URL || DEFAULT_API_URL,
|
|
6534
|
+
runGroupId: options.runGroupId || process.env.SUPATEST_RUN_GROUP_ID,
|
|
6535
|
+
shard: options.shard || this.getShardFromEnv(),
|
|
6136
6536
|
uploadAssets: options.uploadAssets ?? true,
|
|
6137
6537
|
maxConcurrentUploads: options.maxConcurrentUploads ?? DEFAULT_MAX_CONCURRENT_UPLOADS,
|
|
6138
6538
|
retryAttempts: options.retryAttempts ?? DEFAULT_RETRY_ATTEMPTS,
|
|
@@ -6169,7 +6569,9 @@ var SupatestCypressReporter = class {
|
|
|
6169
6569
|
try {
|
|
6170
6570
|
const runRequest = {
|
|
6171
6571
|
projectId: this.options.projectId,
|
|
6572
|
+
runGroupId: this.options.runGroupId,
|
|
6172
6573
|
startedAt: this.startedAt,
|
|
6574
|
+
shard: this.options.shard,
|
|
6173
6575
|
cypress: {
|
|
6174
6576
|
version: this.cypressVersion || "unknown",
|
|
6175
6577
|
browser: this.browserName || "electron"
|
|
@@ -6192,7 +6594,8 @@ var SupatestCypressReporter = class {
|
|
|
6192
6594
|
this.runId = response.runId;
|
|
6193
6595
|
this.unregisterInterruptHandler = registerInterruptHandler(
|
|
6194
6596
|
this.client,
|
|
6195
|
-
() => this.runId
|
|
6597
|
+
() => this.runId,
|
|
6598
|
+
() => this.options.shard
|
|
6196
6599
|
);
|
|
6197
6600
|
logInfo(`Run ${this.runId} started (${details.specs.length} spec files)`);
|
|
6198
6601
|
} catch (error) {
|
|
@@ -6234,6 +6637,7 @@ var SupatestCypressReporter = class {
|
|
|
6234
6637
|
await this.client.completeRun(this.runId, {
|
|
6235
6638
|
status: (results == null ? void 0 : results.status) === "finished" ? "complete" : "errored",
|
|
6236
6639
|
endedAt: (results == null ? void 0 : results.endedTestsAt) ?? (/* @__PURE__ */ new Date()).toISOString(),
|
|
6640
|
+
shard: this.options.shard,
|
|
6237
6641
|
summary,
|
|
6238
6642
|
timing: {
|
|
6239
6643
|
totalDurationMs: (results == null ? void 0 : results.totalDuration) ?? 0,
|
|
@@ -6369,7 +6773,7 @@ var SupatestCypressReporter = class {
|
|
|
6369
6773
|
if (screenshot.path) {
|
|
6370
6774
|
attachments.push({
|
|
6371
6775
|
name: screenshot.name || "screenshot",
|
|
6372
|
-
filename:
|
|
6776
|
+
filename: import_node_path2.default.basename(screenshot.path),
|
|
6373
6777
|
contentType: "image/png",
|
|
6374
6778
|
sizeBytes: getFileSize(screenshot.path),
|
|
6375
6779
|
kind: "screenshot"
|
|
@@ -6379,7 +6783,7 @@ var SupatestCypressReporter = class {
|
|
|
6379
6783
|
if (specResults.video) {
|
|
6380
6784
|
attachments.push({
|
|
6381
6785
|
name: "video",
|
|
6382
|
-
filename:
|
|
6786
|
+
filename: import_node_path2.default.basename(specResults.video),
|
|
6383
6787
|
contentType: "video/mp4",
|
|
6384
6788
|
sizeBytes: getFileSize(specResults.video),
|
|
6385
6789
|
kind: "video"
|
|
@@ -6395,7 +6799,7 @@ var SupatestCypressReporter = class {
|
|
|
6395
6799
|
path: screenshot.path,
|
|
6396
6800
|
meta: {
|
|
6397
6801
|
name: screenshot.name || "screenshot",
|
|
6398
|
-
filename:
|
|
6802
|
+
filename: import_node_path2.default.basename(screenshot.path),
|
|
6399
6803
|
contentType: "image/png",
|
|
6400
6804
|
sizeBytes: getFileSize(screenshot.path),
|
|
6401
6805
|
kind: "screenshot"
|
|
@@ -6408,7 +6812,7 @@ var SupatestCypressReporter = class {
|
|
|
6408
6812
|
path: specResults.video,
|
|
6409
6813
|
meta: {
|
|
6410
6814
|
name: "video",
|
|
6411
|
-
filename:
|
|
6815
|
+
filename: import_node_path2.default.basename(specResults.video),
|
|
6412
6816
|
contentType: "video/mp4",
|
|
6413
6817
|
sizeBytes: getFileSize(specResults.video),
|
|
6414
6818
|
kind: "video"
|
|
@@ -6421,19 +6825,19 @@ var SupatestCypressReporter = class {
|
|
|
6421
6825
|
testResultId,
|
|
6422
6826
|
attachments: attachments.map((a) => a.meta)
|
|
6423
6827
|
});
|
|
6424
|
-
const uploadItems = uploads.map((u,
|
|
6828
|
+
const uploadItems = uploads.map((u, i2) => ({
|
|
6425
6829
|
signedUrl: u.signedUrl,
|
|
6426
|
-
filePath: attachments[
|
|
6427
|
-
contentType: attachments[
|
|
6830
|
+
filePath: attachments[i2].path,
|
|
6831
|
+
contentType: attachments[i2].meta.contentType
|
|
6428
6832
|
}));
|
|
6429
6833
|
const results = await this.uploader.uploadBatch(uploadItems, uploads);
|
|
6430
|
-
const failures = results.filter((
|
|
6834
|
+
const failures = results.filter((r2) => !r2.success);
|
|
6431
6835
|
if (failures.length > 0) {
|
|
6432
6836
|
failures.forEach((failure) => {
|
|
6433
6837
|
const attachment = attachments.find(
|
|
6434
|
-
(
|
|
6838
|
+
(_2, i2) => {
|
|
6435
6839
|
var _a2;
|
|
6436
|
-
return ((_a2 = uploads[
|
|
6840
|
+
return ((_a2 = uploads[i2]) == null ? void 0 : _a2.attachmentId) === failure.attachmentId;
|
|
6437
6841
|
}
|
|
6438
6842
|
);
|
|
6439
6843
|
this.errorCollector.recordError(
|
|
@@ -6462,6 +6866,14 @@ var SupatestCypressReporter = class {
|
|
|
6462
6866
|
async getGitInfo() {
|
|
6463
6867
|
return getGitInfoWithCI(this.rootDir);
|
|
6464
6868
|
}
|
|
6869
|
+
getShardFromEnv() {
|
|
6870
|
+
const current = Number(process.env.SUPATEST_SHARD_CURRENT);
|
|
6871
|
+
const total = Number(process.env.SUPATEST_SHARD_TOTAL);
|
|
6872
|
+
if (!Number.isInteger(current) || !Number.isInteger(total) || current < 1 || total < 1) {
|
|
6873
|
+
return void 0;
|
|
6874
|
+
}
|
|
6875
|
+
return { current, total };
|
|
6876
|
+
}
|
|
6465
6877
|
};
|
|
6466
6878
|
function supatestPlugin(on, config, options = {}) {
|
|
6467
6879
|
const reporter = new SupatestCypressReporter(options);
|