@vltpkg/cli-js 1.4.0 → 1.6.0

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.
Files changed (105) hide show
  1. package/{access-422UGEWN.js → access-AJ654YKY.js} +13 -12
  2. package/{bugs-RED7Y33Q.js → bugs-N73DVYHD.js} +32 -25
  3. package/{build-IHMPBWRO.js → build-VZ3EZKMM.js} +65 -21
  4. package/{cache-FJP2RZJX.js → cache-VROEWG2C.js} +20 -17
  5. package/cache-unzip-src-unzip.js +58 -15
  6. package/{chunk-TPRK6IDA.js → chunk-22LZBDEC.js} +2 -2
  7. package/chunk-36UIE654.js +6248 -0
  8. package/{chunk-UGCKF5ZE.js → chunk-3JIN46K5.js} +1 -1
  9. package/{chunk-OAJ3PO3Z.js → chunk-44AWMA4F.js} +25 -13
  10. package/chunk-4E65BBTM.js +77 -0
  11. package/{chunk-SR2VOY5J.js → chunk-4GMNWW4C.js} +1 -1
  12. package/{chunk-5IJTPZXP.js → chunk-6D3QAFNZ.js} +1 -1
  13. package/{chunk-X4FVR4R5.js → chunk-75HGJVNG.js} +12 -10
  14. package/{chunk-THSYN5EK.js → chunk-7M2VTFLP.js} +12 -1
  15. package/{chunk-2AMOC4DN.js → chunk-ANW36H4T.js} +4 -4
  16. package/chunk-B6RIGNEO.js +626 -0
  17. package/{chunk-FLH4YC6W.js → chunk-BF5DRGRZ.js} +60 -15
  18. package/chunk-BH5CVXNY.js +115 -0
  19. package/{chunk-PLG3OYCX.js → chunk-CAV7FKWQ.js} +3 -2
  20. package/{chunk-C23TDXRG.js → chunk-CYK6I4M6.js} +1 -1
  21. package/chunk-DXED4ARV.js +436 -0
  22. package/chunk-E74WGW5C.js +49 -0
  23. package/{chunk-WF6KLKRN.js → chunk-EFHOWRKU.js} +103 -1
  24. package/chunk-EMTGRCSE.js +1111 -0
  25. package/{chunk-5Y4SYLJ2.js → chunk-EYGOEAJM.js} +1 -1
  26. package/{chunk-OVPHE4O7.js → chunk-F5LZMLAQ.js} +5335 -10902
  27. package/{chunk-HZXJ423P.js → chunk-FXD3IV2S.js} +4 -2
  28. package/chunk-GCTREKA4.js +115 -0
  29. package/{chunk-ZJMJ7MCT.js → chunk-GEQFMH5M.js} +1 -1
  30. package/{chunk-ISE4IRHF.js → chunk-GZVI75KX.js} +7 -14
  31. package/chunk-HOF7LEIC.js +24 -0
  32. package/{chunk-LHPEBLOU.js → chunk-HT6FS4VB.js} +1 -1
  33. package/{chunk-PHJJPY5G.js → chunk-IXAMCWIT.js} +5 -5
  34. package/{chunk-ASLX43R3.js → chunk-JCNI6ZHH.js} +7 -5
  35. package/chunk-JV5XR5JQ.js +349 -0
  36. package/{chunk-7T3XAYP4.js → chunk-KD5ZK72K.js} +1 -1
  37. package/{chunk-FZUYGJZU.js → chunk-KVWGMSPW.js} +137 -19
  38. package/{chunk-TO23PR7J.js → chunk-LCLRP64K.js} +14 -12
  39. package/{chunk-QCSUWACA.js → chunk-LGQVZTYR.js} +8 -36
  40. package/{chunk-5RHABCYI.js → chunk-LP3ORD3D.js} +143 -17
  41. package/chunk-MCDLJZXT.js +82 -0
  42. package/{chunk-DNRR3XMG.js → chunk-N6HV7JWC.js} +1 -1
  43. package/chunk-O6MQ7NN6.js +1155 -0
  44. package/{chunk-GIIAODRI.js → chunk-PC2HOBAQ.js} +7 -5
  45. package/{chunk-APMYKJI2.js → chunk-QNHBAGXQ.js} +1 -1
  46. package/chunk-RBQO54TG.js +59 -0
  47. package/chunk-SUU2WETN.js +268 -0
  48. package/{chunk-I7UMHYZX.js → chunk-TQQO2F56.js} +113 -1187
  49. package/{chunk-4UCADW6S.js → chunk-TWDSXQPN.js} +9 -7
  50. package/{chunk-MKWPTN3C.js → chunk-VLVMLSIF.js} +2 -2
  51. package/chunk-W4T5CGCO.js +52 -0
  52. package/{chunk-5TNXLRW2.js → chunk-YTDABXPD.js} +50 -12
  53. package/{ci-YSKNNO5M.js → ci-3BVMVQIT.js} +35 -13
  54. package/cli-package.json +3 -1
  55. package/{config-HO7GY3QT.js → config-2KQV7N5A.js} +16 -13
  56. package/{config-CSPCDMR3.js → config-EKHBW6I5.js} +12 -9
  57. package/{create-2TJT3AHJ.js → create-QVHNOIV3.js} +35 -29
  58. package/{deprecate-7FRJI2RL.js → deprecate-E254QBH6.js} +17 -15
  59. package/{dist-tag-WCFF5OEG.js → dist-tag-SITRFD7O.js} +13 -12
  60. package/{docs-JMBPTU23.js → docs-IDL2P7CA.js} +32 -25
  61. package/{exec-FBOUKZZ2.js → exec-7BK2W2WL.js} +35 -29
  62. package/{exec-cache-X3ZWM5S3.js → exec-cache-VY46L7DR.js} +27 -21
  63. package/{exec-local-Y3KQC22N.js → exec-local-D7R5T3DF.js} +26 -20
  64. package/{help-PUKVH5X7.js → help-RMRIEJQL.js} +6 -5
  65. package/{init-GOKAQXXZ.js → init-BGW4HJ6V.js} +15 -11
  66. package/{install-XFN4UFOC.js → install-U5GATZ2N.js} +144 -49
  67. package/{list-43JFFG5D.js → list-3VG4M2XL.js} +41 -28
  68. package/{login-RSTZKNKN.js → login-PHQWI6S6.js} +19 -16
  69. package/{logout-4576FFXZ.js → logout-DJCOGRFF.js} +13 -12
  70. package/{outdated-ACQ5A2Y7.js → outdated-JH3O6R3Y.js} +27 -22
  71. package/{pack-QQVJ3G25.js → pack-U5W5YWHK.js} +23 -18
  72. package/package.json +1 -1
  73. package/{ping-QCDQQRO5.js → ping-EKX43AOW.js} +13 -12
  74. package/{pkg-CSOJV7UC.js → pkg-SW5GMERT.js} +19 -14
  75. package/{profile-VL4HPW3N.js → profile-UGDRDMQ6.js} +13 -12
  76. package/{publish-2YBO6ZXE.js → publish-HTWKK3NN.js} +60 -45
  77. package/{query-IHHFMJRT.js → query-YE3FUVGG.js} +43 -30
  78. package/{registry-W7BRZZZ2.js → registry-ZGGWVLBM.js} +7 -7
  79. package/registry-client-src-revalidate.js +76 -22
  80. package/{repo-L3BXAAWS.js → repo-WDOCU6SE.js} +32 -25
  81. package/{reporter-5NYOHBO7.js → reporter-N5PAXB26.js} +121 -17
  82. package/{run-AMUUVLTI.js → run-IPARVIIQ.js} +26 -20
  83. package/{run-exec-5W3XWQZA.js → run-exec-C4RTREEW.js} +26 -20
  84. package/security-archive-src-update-expired.js +66 -21
  85. package/{setup-TFM4GJF7.js → setup-SYYUEHZL.js} +212 -32
  86. package/skills-KA2VR5Q5.js +480 -0
  87. package/skills-UBBMSBDQ.js +416 -0
  88. package/{src-4CYCUWZL.js → src-FUSTSM4J.js} +33 -22
  89. package/{src-I3GMULFP.js → src-QO5G2S4O.js} +11 -8
  90. package/{src-LUTN2ODD.js → src-W2VQULRG.js} +2 -2
  91. package/{token-OANOBE3G.js → token-UQNABECH.js} +15 -13
  92. package/{uninstall-YXTQ4AIZ.js → uninstall-FHBJ3OUV.js} +59 -18
  93. package/{unpublish-SZXYMYIU.js → unpublish-APJTEUBA.js} +31 -16
  94. package/{update-FHLMWGIM.js → update-NWZTL4S7.js} +52 -25
  95. package/{version-ZWFCTU5V.js → version-EMKKTL77.js} +20 -14
  96. package/{view-NFNJXMLV.js → view-BUUI33RV.js} +17 -15
  97. package/vlr.js +1 -1
  98. package/vlrx.js +1 -1
  99. package/vlt.js +1 -1
  100. package/vlx.js +1 -1
  101. package/vlxl.js +1 -1
  102. package/{whoami-O7GOSGCI.js → whoami-F6BSXGQ2.js} +13 -12
  103. package/chunk-G2YT2GWF.js +0 -120
  104. package/chunk-T6FBP4OU.js +0 -76
  105. package/chunk-U7TEQCBN.js +0 -880
@@ -0,0 +1,1111 @@
1
+ var global = globalThis;
2
+ import {Buffer} from "node:buffer";
3
+ import {setTimeout as _vlt_setTimeout,clearTimeout as _vlt_clearTimeout,setImmediate as _vlt_setImmediate,clearImmediate as _vlt_clearImmediate,setInterval as _vlt_setInterval,clearInterval as _vlt_clearInterval} from "node:timers";
4
+ globalThis.setTimeout = _vlt_setTimeout;
5
+ globalThis.clearTimeout = _vlt_clearTimeout;
6
+ globalThis.setImmediate = _vlt_setImmediate;
7
+ globalThis.clearImmediate = _vlt_clearImmediate;
8
+ globalThis.setInterval = _vlt_setInterval;
9
+ globalThis.clearInterval = _vlt_clearInterval;
10
+ import {createRequire as _vlt_createRequire} from "node:module";
11
+ var require = _vlt_createRequire(import.meta.filename);
12
+ import {
13
+ Spec
14
+ } from "./chunk-6D3QAFNZ.js";
15
+ import {
16
+ promiseSpawn,
17
+ whichSync
18
+ } from "./chunk-SUU2WETN.js";
19
+ import {
20
+ I
21
+ } from "./chunk-B6RIGNEO.js";
22
+ import {
23
+ Range,
24
+ Version,
25
+ isRange,
26
+ isSpec,
27
+ parse,
28
+ satisfies
29
+ } from "./chunk-BF5DRGRZ.js";
30
+ import {
31
+ error
32
+ } from "./chunk-WZWDS3W4.js";
33
+ import {
34
+ __commonJS,
35
+ __toESM
36
+ } from "./chunk-PZLD7RTK.js";
37
+
38
+ // ../../node_modules/.vlt/~npm~err-code@2.0.3/node_modules/err-code/index.js
39
+ var require_err_code = __commonJS({
40
+ "../../node_modules/.vlt/~npm~err-code@2.0.3/node_modules/err-code/index.js"(exports, module) {
41
+ "use strict";
42
+ function assign(obj, props) {
43
+ for (const key in props) {
44
+ Object.defineProperty(obj, key, {
45
+ value: props[key],
46
+ enumerable: true,
47
+ configurable: true
48
+ });
49
+ }
50
+ return obj;
51
+ }
52
+ function createError(err, code, props) {
53
+ if (!err || typeof err === "string") {
54
+ throw new TypeError("Please pass an Error to err-code");
55
+ }
56
+ if (!props) {
57
+ props = {};
58
+ }
59
+ if (typeof code === "object") {
60
+ props = code;
61
+ code = void 0;
62
+ }
63
+ if (code != null) {
64
+ props.code = code;
65
+ }
66
+ try {
67
+ return assign(err, props);
68
+ } catch (_) {
69
+ props.message = err.message;
70
+ props.stack = err.stack;
71
+ const ErrClass = function() {
72
+ };
73
+ ErrClass.prototype = Object.create(Object.getPrototypeOf(err));
74
+ return assign(new ErrClass(), props);
75
+ }
76
+ }
77
+ module.exports = createError;
78
+ }
79
+ });
80
+
81
+ // ../../node_modules/.vlt/~npm~retry@0.12.0/node_modules/retry/lib/retry_operation.js
82
+ var require_retry_operation = __commonJS({
83
+ "../../node_modules/.vlt/~npm~retry@0.12.0/node_modules/retry/lib/retry_operation.js"(exports, module) {
84
+ function RetryOperation(timeouts, options) {
85
+ if (typeof options === "boolean") {
86
+ options = { forever: options };
87
+ }
88
+ this._originalTimeouts = JSON.parse(JSON.stringify(timeouts));
89
+ this._timeouts = timeouts;
90
+ this._options = options || {};
91
+ this._maxRetryTime = options && options.maxRetryTime || Infinity;
92
+ this._fn = null;
93
+ this._errors = [];
94
+ this._attempts = 1;
95
+ this._operationTimeout = null;
96
+ this._operationTimeoutCb = null;
97
+ this._timeout = null;
98
+ this._operationStart = null;
99
+ if (this._options.forever) {
100
+ this._cachedTimeouts = this._timeouts.slice(0);
101
+ }
102
+ }
103
+ module.exports = RetryOperation;
104
+ RetryOperation.prototype.reset = function() {
105
+ this._attempts = 1;
106
+ this._timeouts = this._originalTimeouts;
107
+ };
108
+ RetryOperation.prototype.stop = function() {
109
+ if (this._timeout) {
110
+ clearTimeout(this._timeout);
111
+ }
112
+ this._timeouts = [];
113
+ this._cachedTimeouts = null;
114
+ };
115
+ RetryOperation.prototype.retry = function(err) {
116
+ if (this._timeout) {
117
+ clearTimeout(this._timeout);
118
+ }
119
+ if (!err) {
120
+ return false;
121
+ }
122
+ var currentTime = (/* @__PURE__ */ new Date()).getTime();
123
+ if (err && currentTime - this._operationStart >= this._maxRetryTime) {
124
+ this._errors.unshift(new Error("RetryOperation timeout occurred"));
125
+ return false;
126
+ }
127
+ this._errors.push(err);
128
+ var timeout = this._timeouts.shift();
129
+ if (timeout === void 0) {
130
+ if (this._cachedTimeouts) {
131
+ this._errors.splice(this._errors.length - 1, this._errors.length);
132
+ this._timeouts = this._cachedTimeouts.slice(0);
133
+ timeout = this._timeouts.shift();
134
+ } else {
135
+ return false;
136
+ }
137
+ }
138
+ var self = this;
139
+ var timer = setTimeout(function() {
140
+ self._attempts++;
141
+ if (self._operationTimeoutCb) {
142
+ self._timeout = setTimeout(function() {
143
+ self._operationTimeoutCb(self._attempts);
144
+ }, self._operationTimeout);
145
+ if (self._options.unref) {
146
+ self._timeout.unref();
147
+ }
148
+ }
149
+ self._fn(self._attempts);
150
+ }, timeout);
151
+ if (this._options.unref) {
152
+ timer.unref();
153
+ }
154
+ return true;
155
+ };
156
+ RetryOperation.prototype.attempt = function(fn, timeoutOps) {
157
+ this._fn = fn;
158
+ if (timeoutOps) {
159
+ if (timeoutOps.timeout) {
160
+ this._operationTimeout = timeoutOps.timeout;
161
+ }
162
+ if (timeoutOps.cb) {
163
+ this._operationTimeoutCb = timeoutOps.cb;
164
+ }
165
+ }
166
+ var self = this;
167
+ if (this._operationTimeoutCb) {
168
+ this._timeout = setTimeout(function() {
169
+ self._operationTimeoutCb();
170
+ }, self._operationTimeout);
171
+ }
172
+ this._operationStart = (/* @__PURE__ */ new Date()).getTime();
173
+ this._fn(this._attempts);
174
+ };
175
+ RetryOperation.prototype.try = function(fn) {
176
+ console.log("Using RetryOperation.try() is deprecated");
177
+ this.attempt(fn);
178
+ };
179
+ RetryOperation.prototype.start = function(fn) {
180
+ console.log("Using RetryOperation.start() is deprecated");
181
+ this.attempt(fn);
182
+ };
183
+ RetryOperation.prototype.start = RetryOperation.prototype.try;
184
+ RetryOperation.prototype.errors = function() {
185
+ return this._errors;
186
+ };
187
+ RetryOperation.prototype.attempts = function() {
188
+ return this._attempts;
189
+ };
190
+ RetryOperation.prototype.mainError = function() {
191
+ if (this._errors.length === 0) {
192
+ return null;
193
+ }
194
+ var counts = {};
195
+ var mainError = null;
196
+ var mainErrorCount = 0;
197
+ for (var i = 0; i < this._errors.length; i++) {
198
+ var error2 = this._errors[i];
199
+ var message = error2.message;
200
+ var count = (counts[message] || 0) + 1;
201
+ counts[message] = count;
202
+ if (count >= mainErrorCount) {
203
+ mainError = error2;
204
+ mainErrorCount = count;
205
+ }
206
+ }
207
+ return mainError;
208
+ };
209
+ }
210
+ });
211
+
212
+ // ../../node_modules/.vlt/~npm~retry@0.12.0/node_modules/retry/lib/retry.js
213
+ var require_retry = __commonJS({
214
+ "../../node_modules/.vlt/~npm~retry@0.12.0/node_modules/retry/lib/retry.js"(exports) {
215
+ var RetryOperation = require_retry_operation();
216
+ exports.operation = function(options) {
217
+ var timeouts = exports.timeouts(options);
218
+ return new RetryOperation(timeouts, {
219
+ forever: options && options.forever,
220
+ unref: options && options.unref,
221
+ maxRetryTime: options && options.maxRetryTime
222
+ });
223
+ };
224
+ exports.timeouts = function(options) {
225
+ if (options instanceof Array) {
226
+ return [].concat(options);
227
+ }
228
+ var opts2 = {
229
+ retries: 10,
230
+ factor: 2,
231
+ minTimeout: 1 * 1e3,
232
+ maxTimeout: Infinity,
233
+ randomize: false
234
+ };
235
+ for (var key in options) {
236
+ opts2[key] = options[key];
237
+ }
238
+ if (opts2.minTimeout > opts2.maxTimeout) {
239
+ throw new Error("minTimeout is greater than maxTimeout");
240
+ }
241
+ var timeouts = [];
242
+ for (var i = 0; i < opts2.retries; i++) {
243
+ timeouts.push(this.createTimeout(i, opts2));
244
+ }
245
+ if (options && options.forever && !timeouts.length) {
246
+ timeouts.push(this.createTimeout(i, opts2));
247
+ }
248
+ timeouts.sort(function(a, b) {
249
+ return a - b;
250
+ });
251
+ return timeouts;
252
+ };
253
+ exports.createTimeout = function(attempt, opts2) {
254
+ var random = opts2.randomize ? Math.random() + 1 : 1;
255
+ var timeout = Math.round(random * opts2.minTimeout * Math.pow(opts2.factor, attempt));
256
+ timeout = Math.min(timeout, opts2.maxTimeout);
257
+ return timeout;
258
+ };
259
+ exports.wrap = function(obj, options, methods) {
260
+ if (options instanceof Array) {
261
+ methods = options;
262
+ options = null;
263
+ }
264
+ if (!methods) {
265
+ methods = [];
266
+ for (var key in obj) {
267
+ if (typeof obj[key] === "function") {
268
+ methods.push(key);
269
+ }
270
+ }
271
+ }
272
+ for (var i = 0; i < methods.length; i++) {
273
+ var method = methods[i];
274
+ var original = obj[method];
275
+ obj[method] = function retryWrapper(original2) {
276
+ var op = exports.operation(options);
277
+ var args = Array.prototype.slice.call(arguments, 1);
278
+ var callback = args.pop();
279
+ args.push(function(err) {
280
+ if (op.retry(err)) {
281
+ return;
282
+ }
283
+ if (err) {
284
+ arguments[0] = op.mainError();
285
+ }
286
+ callback.apply(this, arguments);
287
+ });
288
+ op.attempt(function() {
289
+ original2.apply(obj, args);
290
+ });
291
+ }.bind(obj, original);
292
+ obj[method].options = options;
293
+ }
294
+ };
295
+ }
296
+ });
297
+
298
+ // ../../node_modules/.vlt/~npm~retry@0.12.0/node_modules/retry/index.js
299
+ var require_retry2 = __commonJS({
300
+ "../../node_modules/.vlt/~npm~retry@0.12.0/node_modules/retry/index.js"(exports, module) {
301
+ module.exports = require_retry();
302
+ }
303
+ });
304
+
305
+ // ../../node_modules/.vlt/~npm~promise-retry@2.0.1/node_modules/promise-retry/index.js
306
+ var require_promise_retry = __commonJS({
307
+ "../../node_modules/.vlt/~npm~promise-retry@2.0.1/node_modules/promise-retry/index.js"(exports, module) {
308
+ "use strict";
309
+ var errcode = require_err_code();
310
+ var retry = require_retry2();
311
+ var hasOwn = Object.prototype.hasOwnProperty;
312
+ function isRetryError(err) {
313
+ return err && err.code === "EPROMISERETRY" && hasOwn.call(err, "retried");
314
+ }
315
+ function promiseRetry2(fn, options) {
316
+ var temp;
317
+ var operation;
318
+ if (typeof fn === "object" && typeof options === "function") {
319
+ temp = options;
320
+ options = fn;
321
+ fn = temp;
322
+ }
323
+ operation = retry.operation(options);
324
+ return new Promise(function(resolve3, reject) {
325
+ operation.attempt(function(number) {
326
+ Promise.resolve().then(function() {
327
+ return fn(function(err) {
328
+ if (isRetryError(err)) {
329
+ err = err.retried;
330
+ }
331
+ throw errcode(new Error("Retrying"), "EPROMISERETRY", { retried: err });
332
+ }, number);
333
+ }).then(resolve3, function(err) {
334
+ if (isRetryError(err)) {
335
+ err = err.retried;
336
+ if (operation.retry(err || new Error())) {
337
+ return;
338
+ }
339
+ }
340
+ reject(err);
341
+ });
342
+ });
343
+ });
344
+ }
345
+ module.exports = promiseRetry2;
346
+ }
347
+ });
348
+
349
+ // ../../src/pick-manifest/src/index.ts
350
+ import { readFileSync } from "node:fs";
351
+ var parsedNodeVersion = Version.parse(process.version);
352
+ var versionCache = /* @__PURE__ */ new Map();
353
+ var MAX_VERSION_CACHE = 32768;
354
+ var parsedVersion = (ver) => {
355
+ const cached = versionCache.get(ver);
356
+ if (cached !== void 0 || versionCache.has(ver)) return cached;
357
+ const parsed = parse(ver);
358
+ if (versionCache.size >= MAX_VERSION_CACHE) versionCache.clear();
359
+ versionCache.set(ver, parsed);
360
+ return parsed;
361
+ };
362
+ var isBefore = (version, before, verTimes) => {
363
+ if (!verTimes || !version || !before) return true;
364
+ const time = version && verTimes[version];
365
+ return !!time && Date.parse(time) <= before;
366
+ };
367
+ var checkList = (value, list) => {
368
+ if (typeof list === "string") {
369
+ list = [list];
370
+ }
371
+ if (!Array.isArray(list)) return true;
372
+ if (list.length === 1 && list[0] === "any") {
373
+ return true;
374
+ }
375
+ let negated = 0;
376
+ let match = false;
377
+ for (const entry of list) {
378
+ const negate = entry.startsWith("!");
379
+ const test = negate ? entry.slice(1) : entry;
380
+ if (negate) {
381
+ negated++;
382
+ if (value === test) {
383
+ return false;
384
+ }
385
+ } else {
386
+ match = match || value === test;
387
+ }
388
+ }
389
+ return match || negated === list.length;
390
+ };
391
+ var isMusl = (file) => file.includes("libc.musl-") || file.includes("ld-musl-");
392
+ var LDD_PATH = "/usr/bin/ldd";
393
+ var getFamilyFromFilesystem = () => {
394
+ try {
395
+ const content = readFileSync(LDD_PATH, "utf-8");
396
+ if (content.includes("musl")) {
397
+ return "musl";
398
+ }
399
+ if (content.includes("GNU C Library")) {
400
+ return "glibc";
401
+ }
402
+ return null;
403
+ } catch {
404
+ return void 0;
405
+ }
406
+ };
407
+ var getFamilyFromReport = () => {
408
+ try {
409
+ const processReport = process.report;
410
+ const originalExclude = processReport.excludeNetwork === true;
411
+ processReport.excludeNetwork = true;
412
+ const report = processReport.getReport();
413
+ processReport.excludeNetwork = originalExclude;
414
+ if (report?.header?.glibcRuntimeVersion) {
415
+ return "glibc";
416
+ }
417
+ if (Array.isArray(report?.sharedObjects) && report.sharedObjects.some(isMusl)) {
418
+ return "musl";
419
+ }
420
+ } catch {
421
+ }
422
+ return null;
423
+ };
424
+ var cachedLibcFamily = void 0;
425
+ var detectLibc = () => {
426
+ if (cachedLibcFamily !== void 0) {
427
+ return cachedLibcFamily ?? void 0;
428
+ }
429
+ if (process.platform !== "linux") {
430
+ cachedLibcFamily = null;
431
+ return void 0;
432
+ }
433
+ let family = getFamilyFromFilesystem();
434
+ if (!family) {
435
+ family = getFamilyFromReport();
436
+ }
437
+ cachedLibcFamily = family;
438
+ return family ?? void 0;
439
+ };
440
+ var platformCheck = (mani, nodeVersion, wantOs, wantArch, wantLibc) => {
441
+ const { engines, os, cpu, libc } = mani;
442
+ if (engines) {
443
+ const { node } = engines;
444
+ if (node && !satisfies(nodeVersion, node, true)) {
445
+ return false;
446
+ }
447
+ }
448
+ if (wantOs && !checkList(wantOs, os)) return false;
449
+ if (wantArch && !checkList(wantArch, cpu)) return false;
450
+ if (libc) {
451
+ const libcFamily = wantLibc ?? detectLibc();
452
+ if (!libcFamily) return false;
453
+ if (!checkList(libcFamily, libc)) return false;
454
+ }
455
+ return true;
456
+ };
457
+ var versionOk = (packument, version, nodeVersion, os, arch, libc, before) => {
458
+ const mani = packument.versions[version];
459
+ if (!mani) return false;
460
+ const { time } = packument;
461
+ return isBefore(version, before, time) && platformCheck(mani, nodeVersion, os, arch, libc);
462
+ };
463
+ function pickManifest(packument, wanted, opts2 = {}) {
464
+ const {
465
+ tag = "latest",
466
+ before,
467
+ "node-version": nodeVersion,
468
+ os = process.platform,
469
+ arch = process.arch,
470
+ libc
471
+ } = opts2;
472
+ const nv = !nodeVersion ? parsedNodeVersion : Version.parse(nodeVersion);
473
+ const libcFamily = libc ?? detectLibc();
474
+ const {
475
+ name,
476
+ time: verTimes,
477
+ versions: versions2,
478
+ "dist-tags": distTags2
479
+ } = packument;
480
+ const time = before && verTimes ? +new Date(before) : Infinity;
481
+ let range = void 0;
482
+ let spec = void 0;
483
+ if (typeof wanted === "object") {
484
+ if (isSpec(wanted)) {
485
+ const f = wanted.final;
486
+ range = f.range;
487
+ spec = f;
488
+ } else if (isRange(wanted)) {
489
+ range = wanted;
490
+ }
491
+ } else {
492
+ spec = Spec.parse(`${name}@${wanted}`).final;
493
+ range = spec.range;
494
+ }
495
+ if (!range) {
496
+ if (!spec?.distTag) {
497
+ throw error(
498
+ "Only dist-tag or semver range specs are supported",
499
+ { spec }
500
+ );
501
+ }
502
+ const ver = distTags2[spec.distTag];
503
+ if (!ver) return void 0;
504
+ const mani = versions2[ver];
505
+ if (mani && versionOk(packument, ver, nv, os, arch, libcFamily, time)) {
506
+ return mani;
507
+ } else {
508
+ range = new Range(`<=${ver}`);
509
+ }
510
+ }
511
+ if (range.isAny) range = new Range("*", true);
512
+ const defaultVer = distTags2[tag];
513
+ const defTagVersion = defaultVer ? Version.parse(defaultVer) : void 0;
514
+ if (defaultVer && (range.isAny || defTagVersion?.satisfies(range)) && versionOk(packument, defaultVer, nv, os, arch, libcFamily, time)) {
515
+ return versions2[defaultVer];
516
+ }
517
+ const keys = Object.keys(versions2);
518
+ if (!keys.length) {
519
+ return void 0;
520
+ }
521
+ let found = void 0;
522
+ let foundIsDefTag = false;
523
+ for (const ver of keys) {
524
+ if (verTimes && (before ? !isBefore(ver, time, verTimes) : !verTimes[ver])) {
525
+ continue;
526
+ }
527
+ const mani = versions2[ver];
528
+ const version = parsedVersion(ver);
529
+ if (!version?.satisfies(range)) {
530
+ continue;
531
+ }
532
+ const mc = {
533
+ version,
534
+ deprecated: !!mani.deprecated,
535
+ platform: platformCheck(mani, nv, os, arch, libcFamily),
536
+ prerelease: !!version.prerelease?.length,
537
+ mani
538
+ };
539
+ if (!found) {
540
+ found = mc;
541
+ if (defTagVersion?.equals(found.version)) {
542
+ foundIsDefTag = true;
543
+ }
544
+ continue;
545
+ }
546
+ const mok = !mc.deprecated && mc.platform;
547
+ const fok = !found.deprecated && found.platform;
548
+ if (mok !== fok) {
549
+ if (mok) {
550
+ found = mc;
551
+ foundIsDefTag = !!defTagVersion?.equals(mc.version);
552
+ }
553
+ } else if (mc.platform !== found.platform) {
554
+ if (mc.platform) {
555
+ found = mc;
556
+ foundIsDefTag = !!defTagVersion?.equals(mc.version);
557
+ }
558
+ } else if (mc.deprecated !== found.deprecated) {
559
+ if (!mc.deprecated) {
560
+ found = mc;
561
+ foundIsDefTag = !!defTagVersion?.equals(mc.version);
562
+ }
563
+ } else if (found.prerelease !== mc.prerelease) {
564
+ if (!mc.prerelease) {
565
+ found = mc;
566
+ foundIsDefTag = !!defTagVersion?.equals(mc.version);
567
+ }
568
+ } else if (defTagVersion?.equals(mc.version)) {
569
+ found = mc;
570
+ foundIsDefTag = true;
571
+ } else if (mc.version.greaterThan(found.version) && !foundIsDefTag) {
572
+ found = mc;
573
+ }
574
+ }
575
+ return found?.mani;
576
+ }
577
+
578
+ // ../../src/git/src/spawn.ts
579
+ var import_promise_retry = __toESM(require_promise_retry(), 1);
580
+
581
+ // ../../src/git/src/make-error.ts
582
+ var connectionErrorRe = new RegExp(
583
+ [
584
+ "remote error: Internal Server Error",
585
+ "The remote end hung up unexpectedly",
586
+ "Connection timed out",
587
+ "Operation timed out",
588
+ "Failed to connect to .* Timed out",
589
+ "Connection reset by peer",
590
+ "SSL_ERROR_SYSCALL",
591
+ "The requested URL returned error: 503"
592
+ ].join("|")
593
+ );
594
+ var missingPathspecRe = /pathspec .* did not match any file\(s\) known to git/;
595
+ var makeError = (result) => connectionErrorRe.test(result.stderr) ? [
596
+ (n) => n < 3,
597
+ error("A git connection error occurred", result)
598
+ ] : missingPathspecRe.test(result.stderr) ? [null, error("The git reference could not be found", result)] : [null, error("An unknown git error occurred", result)];
599
+
600
+ // ../../src/git/src/opts.ts
601
+ var gitEnv = {
602
+ GIT_ASKPASS: "echo",
603
+ GIT_SSH_COMMAND: "ssh -oStrictHostKeyChecking=accept-new"
604
+ };
605
+ var opts = (opts2 = {}) => ({
606
+ acceptFail: true,
607
+ ...opts2,
608
+ env: opts2.env ?? { ...gitEnv, ...process.env },
609
+ stdio: "pipe",
610
+ stdioString: true,
611
+ shell: false
612
+ });
613
+
614
+ // ../../src/git/src/which.ts
615
+ var gitPath = void 0;
616
+ var which = (opts2 = {}) => {
617
+ if (opts2.git) {
618
+ return opts2.git;
619
+ }
620
+ let whichError = void 0;
621
+ if (opts2.git !== false) {
622
+ if (!gitPath) {
623
+ try {
624
+ gitPath = whichSync("git");
625
+ } catch (er) {
626
+ whichError = er;
627
+ }
628
+ }
629
+ }
630
+ if (!gitPath || opts2.git === false) {
631
+ return error(
632
+ "No git binary found in $PATH",
633
+ {
634
+ code: "ENOGIT",
635
+ cause: whichError
636
+ },
637
+ which
638
+ );
639
+ }
640
+ return gitPath;
641
+ };
642
+
643
+ // ../../src/git/src/spawn.ts
644
+ var spawn = async (gitArgs, opts2 = {}) => {
645
+ const gitPath2 = which(opts2);
646
+ if (gitPath2 instanceof Error) {
647
+ throw gitPath2;
648
+ }
649
+ const args = opts2.allowReplace || gitArgs[0] === "--no-replace-objects" ? gitArgs : ["--no-replace-objects", ...gitArgs];
650
+ const retryOpts = {
651
+ retries: opts2["fetch-retries"] || 3,
652
+ factor: opts2["fetch-retry-factor"] || 2,
653
+ maxTimeout: opts2["fetch-retry-maxtimeout"] || 6e4,
654
+ minTimeout: opts2["fetch-retry-mintimeout"] || 1e3
655
+ };
656
+ return (0, import_promise_retry.default)(async (retryFn, num) => {
657
+ const result = await promiseSpawn(gitPath2, args, opts(opts2));
658
+ if (result.status || result.signal) {
659
+ const [shouldRetry, gitError] = makeError(result);
660
+ if (!shouldRetry?.(num)) {
661
+ throw gitError;
662
+ }
663
+ retryFn(gitError);
664
+ }
665
+ return result;
666
+ }, retryOpts);
667
+ };
668
+
669
+ // ../../src/git/src/is.ts
670
+ import { stat } from "node:fs/promises";
671
+ var is = ({ cwd = process.cwd() } = {}) => stat(cwd + "/.git").then(
672
+ () => true,
673
+ () => false
674
+ );
675
+
676
+ // ../../src/git/src/is-clean.ts
677
+ var isClean = async (opts2 = {}) => {
678
+ const result = await spawn(
679
+ ["status", "--porcelain=v1", "-uno"],
680
+ opts2
681
+ );
682
+ if (result.status || result.signal) {
683
+ throw error("git isClean check failed", result);
684
+ }
685
+ for (const line of result.stdout.split(/\r?\n+/)) {
686
+ if (line.trim()) return false;
687
+ }
688
+ return true;
689
+ };
690
+
691
+ // ../../src/git-scp-url/src/index.ts
692
+ var knownProtocols = /* @__PURE__ */ new Set([
693
+ "http:",
694
+ "https:",
695
+ "git:",
696
+ "git+ssh:",
697
+ "git+https:",
698
+ "ssh:"
699
+ ]);
700
+ var memo = /* @__PURE__ */ new Map();
701
+ var correctProtocol = (arg) => {
702
+ const firstColon = arg.indexOf(":");
703
+ const proto = arg.slice(0, firstColon + 1);
704
+ const doubleSlash = arg.indexOf("//");
705
+ if (knownProtocols.has(proto)) {
706
+ if (doubleSlash === firstColon + 1) {
707
+ return arg;
708
+ }
709
+ return proto + "//" + arg.slice(firstColon + 1);
710
+ }
711
+ const firstAt = arg.indexOf("@");
712
+ if (firstAt > -1) {
713
+ if (firstAt > firstColon) {
714
+ return `git+ssh://${arg}`;
715
+ } else {
716
+ return arg;
717
+ }
718
+ }
719
+ return proto + "//" + arg.slice(firstColon + 1);
720
+ };
721
+ var correctUrl = (url) => {
722
+ const firstAt = url.indexOf("@");
723
+ const lastHash = url.lastIndexOf("#");
724
+ let firstColon = url.indexOf(":");
725
+ let lastColon = url.lastIndexOf(
726
+ ":",
727
+ lastHash > -1 ? lastHash : Infinity
728
+ );
729
+ let corrected = url;
730
+ if (lastColon > firstAt) {
731
+ corrected = url.slice(0, lastColon) + "/" + url.slice(lastColon + 1);
732
+ firstColon = corrected.indexOf(":");
733
+ lastColon = corrected.lastIndexOf(":");
734
+ }
735
+ if (firstColon === -1 && !url.includes("//")) {
736
+ corrected = `git+ssh://${corrected}`;
737
+ }
738
+ return corrected;
739
+ };
740
+ var gitScpURL = (url) => {
741
+ const memoized = memo.get(url);
742
+ if (memoized) return memoized;
743
+ try {
744
+ const result = new URL(url);
745
+ if (result.hostname) {
746
+ memo.set(url, result);
747
+ return result;
748
+ }
749
+ } catch {
750
+ }
751
+ try {
752
+ const result = new URL(correctUrl(correctProtocol(url)));
753
+ if (result.hostname) {
754
+ memo.set(url, result);
755
+ return result;
756
+ }
757
+ } catch {
758
+ }
759
+ return void 0;
760
+ };
761
+
762
+ // ../../src/git/src/clone.ts
763
+ import { mkdir, stat as stat2 } from "node:fs/promises";
764
+ import { basename, resolve as resolve2 } from "node:path";
765
+ import { fileURLToPath as fileURLToPath2 } from "node:url";
766
+
767
+ // ../../src/git/src/is-windows.ts
768
+ var isWindows = (opts2) => (opts2.fakePlatform || process.platform) === "win32";
769
+
770
+ // ../../src/git/src/revs.ts
771
+ import { fileURLToPath } from "node:url";
772
+
773
+ // ../../src/git/src/lines-to-revs.ts
774
+ var linesToRevs = (lines) => finish(
775
+ lines.reduce(linesToRevsReducer, {
776
+ name: "",
777
+ versions: {},
778
+ "dist-tags": {},
779
+ refs: {},
780
+ shas: {}
781
+ })
782
+ );
783
+ var finish = (revs2) => distTags(versions(shaList(peelTags(revs2))));
784
+ var versions = (revs2) => {
785
+ for (const [version, entry] of Object.entries(revs2.versions)) {
786
+ entry.version = version;
787
+ }
788
+ return revs2;
789
+ };
790
+ var shaList = (revs2) => {
791
+ Object.entries(revs2.refs).forEach(([ref, doc]) => {
792
+ const shas = revs2.shas[doc.sha];
793
+ if (!shas) {
794
+ revs2.shas[doc.sha] = [ref];
795
+ } else {
796
+ shas.push(ref);
797
+ }
798
+ });
799
+ return revs2;
800
+ };
801
+ var peelTags = (revs2) => {
802
+ Object.entries(revs2.refs).filter(([ref]) => ref.endsWith("^{}")).forEach(([ref, peeled]) => {
803
+ const unpeeled = revs2.refs[ref.replace(/\^\{\}$/, "")];
804
+ if (unpeeled) {
805
+ unpeeled.sha = peeled.sha;
806
+ delete revs2.refs[ref];
807
+ }
808
+ });
809
+ return revs2;
810
+ };
811
+ var distTags = (revs2) => {
812
+ const HEAD = revs2.refs.HEAD ?? {
813
+ sha: void 0
814
+ };
815
+ for (const [v, ver] of Object.entries(revs2.versions)) {
816
+ if (ver.sha === revs2.refs.latest?.sha) {
817
+ revs2["dist-tags"].latest = v;
818
+ } else if (ver.sha === HEAD.sha) {
819
+ revs2["dist-tags"].HEAD = v;
820
+ if (!revs2.refs.latest) {
821
+ revs2["dist-tags"].latest = v;
822
+ }
823
+ }
824
+ }
825
+ return revs2;
826
+ };
827
+ var refType = (ref) => {
828
+ if (ref.startsWith("refs/tags/")) {
829
+ return "tag";
830
+ }
831
+ if (ref.startsWith("refs/heads/")) {
832
+ return "branch";
833
+ }
834
+ if (ref.startsWith("refs/pull/")) {
835
+ return "pull";
836
+ }
837
+ if (ref === "HEAD") {
838
+ return "head";
839
+ }
840
+ return "other";
841
+ };
842
+ var lineToRevDoc = (line) => {
843
+ let [sha, rawRef] = line.trim().split(/\s+/, 2);
844
+ if (sha === void 0 || rawRef === void 0) return void 0;
845
+ sha = sha.trim();
846
+ rawRef = rawRef.trim();
847
+ const type = refType(rawRef);
848
+ switch (type) {
849
+ case "tag": {
850
+ const ref = rawRef.slice("refs/tags/".length);
851
+ return { name: "", version: "", sha, ref, rawRef, type };
852
+ }
853
+ case "branch": {
854
+ const ref = rawRef.slice("refs/heads/".length);
855
+ return { name: "", version: "", sha, ref, rawRef, type };
856
+ }
857
+ case "pull": {
858
+ const ref = rawRef.slice("refs/".length).replace(/\/head$/, "");
859
+ return { name: "", version: "", sha, ref, rawRef, type };
860
+ }
861
+ case "head": {
862
+ const ref = "HEAD";
863
+ return { name: "", version: "", sha, ref, rawRef, type };
864
+ }
865
+ default:
866
+ return { name: "", version: "", sha, ref: rawRef, rawRef, type };
867
+ }
868
+ };
869
+ var linesToRevsReducer = (revs2, line) => {
870
+ const doc = lineToRevDoc(line);
871
+ if (!doc) {
872
+ return revs2;
873
+ }
874
+ revs2.refs[doc.ref] = doc;
875
+ revs2.refs[doc.rawRef] = doc;
876
+ if (doc.type === "tag") {
877
+ const match = doc.ref.endsWith("^{}") ? null : /v?(\d+\.\d+\.\d+(?:[-+].+)?)$/.exec(doc.ref);
878
+ if (match) {
879
+ if (!match[1])
880
+ throw error(`invalid semver tag`, { found: doc.ref });
881
+ const v = parse(match[1]);
882
+ if (v) revs2.versions[String(v)] = doc;
883
+ }
884
+ }
885
+ return revs2;
886
+ };
887
+
888
+ // ../../src/git/src/revs.ts
889
+ var fetchMethod = async (repo, _, options) => {
890
+ const result = await spawn(["ls-remote", repo], options.context);
891
+ const revsDoc = linesToRevs(result.stdout.split("\n"));
892
+ return revsDoc;
893
+ };
894
+ var revsCache = new I({
895
+ max: 100,
896
+ ttl: 5 * 60 * 1e3,
897
+ allowStaleOnFetchAbort: true,
898
+ allowStaleOnFetchRejection: true,
899
+ fetchMethod
900
+ });
901
+ var revs = async (repo, opts2 = {}) => {
902
+ repo = String(gitScpURL(repo) ?? repo).replace(/^git\+/, "");
903
+ if (repo.startsWith("file://")) repo = fileURLToPath(repo);
904
+ if (opts2.noGitRevCache) {
905
+ const result = await fetchMethod(repo, void 0, {
906
+ context: opts2
907
+ });
908
+ revsCache.set(repo, result);
909
+ return result;
910
+ }
911
+ return await revsCache.fetch(repo, { context: opts2 });
912
+ };
913
+
914
+ // ../../src/git/src/resolve.ts
915
+ var resolve = async (repo, ref = "HEAD", opts2 = {}) => {
916
+ const revDoc = await revs(repo, opts2);
917
+ if (!revDoc) return void 0;
918
+ return resolveRef(revDoc, ref, opts2);
919
+ };
920
+ var resolveRef = (revDoc, ref = "HEAD", opts2 = {}) => {
921
+ const { spec } = opts2;
922
+ ref = spec?.gitCommittish || ref;
923
+ if (spec?.range) {
924
+ return pickManifest(revDoc, spec.range, opts2);
925
+ }
926
+ if (!ref) {
927
+ return revDoc.refs.HEAD;
928
+ }
929
+ if (revDoc.refs[ref]) {
930
+ return revDoc.refs[ref];
931
+ }
932
+ const sha = revDoc.shas[ref]?.[0];
933
+ if (sha) {
934
+ return revDoc.refs[sha];
935
+ }
936
+ return void 0;
937
+ };
938
+
939
+ // ../../src/git/src/clone.ts
940
+ var shallowHosts = /* @__PURE__ */ new Set([
941
+ "github.com",
942
+ "gist.github.com",
943
+ "gitlab.com",
944
+ "bitbucket.com",
945
+ "bitbucket.org"
946
+ ]);
947
+ var clone = async (repo, ref = "HEAD", target, opts2 = {}) => {
948
+ repo = String(gitScpURL(repo) ?? repo).replace(/^git\+/, "");
949
+ if (repo.startsWith("file://")) repo = fileURLToPath2(repo);
950
+ const revs2 = await revs(repo, opts2);
951
+ return await clone_(
952
+ repo,
953
+ revs2,
954
+ ref,
955
+ revs2 && resolveRef(revs2, ref, opts2),
956
+ target || defaultTarget(repo, opts2.cwd),
957
+ opts2
958
+ );
959
+ };
960
+ var maybeShallow = (repo, opts2) => {
961
+ if (opts2["git-shallow"] === false || opts2["git-shallow"]) {
962
+ return opts2["git-shallow"];
963
+ }
964
+ const host = gitScpURL(repo)?.host ?? "";
965
+ return shallowHosts.has(host);
966
+ };
967
+ var defaultTarget = (repo, cwd = process.cwd()) => resolve2(cwd, basename(repo.replace(/[/\\]?\.git$/, "")));
968
+ var clone_ = (repo, revs2, ref, revDoc, target, opts2) => {
969
+ if (!revDoc || !revs2) {
970
+ return unresolved(repo, ref, target, opts2);
971
+ }
972
+ if (revDoc.sha === revs2.refs.HEAD?.sha) {
973
+ return plain(repo, revDoc, target, opts2);
974
+ }
975
+ if (revDoc.type === "tag" || revDoc.type === "branch") {
976
+ return branch(repo, revDoc, target, opts2);
977
+ }
978
+ return other(repo, revDoc, target, opts2);
979
+ };
980
+ var other = async (repo, revDoc, target, opts2) => {
981
+ const shallow = maybeShallow(repo, opts2);
982
+ const fetchOrigin = ["fetch", "origin", revDoc.rawRef].concat(
983
+ shallow ? ["--depth=1"] : []
984
+ );
985
+ const git = (args) => spawn(args, { ...opts2, cwd: target });
986
+ await mkdir(target, { recursive: true });
987
+ await git(["init"]);
988
+ if (isWindows(opts2)) {
989
+ await git([
990
+ "config",
991
+ "--local",
992
+ "--add",
993
+ "core.longpaths",
994
+ "true"
995
+ ]);
996
+ }
997
+ await git(["remote", "add", "origin", repo]);
998
+ await git(fetchOrigin);
999
+ await git(["checkout", revDoc.sha]);
1000
+ await updateSubmodules(target, opts2);
1001
+ return revDoc.sha;
1002
+ };
1003
+ var branch = async (repo, revDoc, target, opts2) => {
1004
+ const args = [
1005
+ "clone",
1006
+ "-b",
1007
+ revDoc.ref,
1008
+ repo,
1009
+ target,
1010
+ "--recurse-submodules"
1011
+ ];
1012
+ if (maybeShallow(repo, opts2)) {
1013
+ args.push("--depth=1");
1014
+ }
1015
+ if (isWindows(opts2)) {
1016
+ args.push("--config", "core.longpaths=true");
1017
+ }
1018
+ await spawn(args, opts2);
1019
+ return revDoc.sha;
1020
+ };
1021
+ var plain = async (repo, revDoc, target, opts2) => {
1022
+ const args = ["clone", repo, target, "--recurse-submodules"];
1023
+ if (maybeShallow(repo, opts2)) {
1024
+ args.push("--depth=1");
1025
+ }
1026
+ if (isWindows(opts2)) {
1027
+ args.push("--config", "core.longpaths=true");
1028
+ }
1029
+ await spawn(args, opts2);
1030
+ return revDoc.sha;
1031
+ };
1032
+ var updateSubmodules = async (target, opts2) => {
1033
+ const hasSubmodules = await stat2(`${target}/.gitmodules`).then(() => true).catch(() => false);
1034
+ if (!hasSubmodules) {
1035
+ return;
1036
+ }
1037
+ await spawn(
1038
+ ["submodule", "update", "-q", "--init", "--recursive"],
1039
+ { ...opts2, cwd: target }
1040
+ );
1041
+ };
1042
+ var unresolved = async (repo, ref, target, opts2) => {
1043
+ const lp = isWindows(opts2) ? ["--config", "core.longpaths=true"] : [];
1044
+ const cloneArgs = [
1045
+ "clone",
1046
+ "--mirror",
1047
+ "-q",
1048
+ repo,
1049
+ target + "/.git"
1050
+ ];
1051
+ const git = (args) => spawn(args, { ...opts2, cwd: target });
1052
+ await mkdir(target, { recursive: true });
1053
+ await git(cloneArgs.concat(lp));
1054
+ await git(["init"]);
1055
+ await git(["checkout", ref]);
1056
+ await updateSubmodules(target, opts2);
1057
+ const result = await git(["rev-parse", "--revs-only", "HEAD"]);
1058
+ return result.stdout;
1059
+ };
1060
+
1061
+ // ../../src/git/src/user.ts
1062
+ var getUser = async (opts2 = {}) => {
1063
+ let name = "";
1064
+ let email = "";
1065
+ const oldFlagUserNameResult = await spawn(
1066
+ ["config", "--get", "user.name"],
1067
+ opts2
1068
+ );
1069
+ if (oldFlagUserNameResult.status || oldFlagUserNameResult.signal) {
1070
+ const userNameResult = await spawn(
1071
+ ["config", "get", "user.name"],
1072
+ opts2
1073
+ );
1074
+ name = userNameResult.status || userNameResult.signal ? "" : userNameResult.stdout.trim();
1075
+ } else {
1076
+ name = oldFlagUserNameResult.stdout.trim();
1077
+ }
1078
+ const oldFlagUserEmailResult = await spawn(
1079
+ ["config", "--get", "user.email"],
1080
+ opts2
1081
+ );
1082
+ if (oldFlagUserEmailResult.status || oldFlagUserEmailResult.signal) {
1083
+ const userEmailResult = await spawn(
1084
+ ["config", "get", "user.email"],
1085
+ opts2
1086
+ );
1087
+ email = userEmailResult.status || userEmailResult.signal ? "" : userEmailResult.stdout.trim();
1088
+ } else {
1089
+ email = oldFlagUserEmailResult.stdout.trim();
1090
+ }
1091
+ if (!name && !email) {
1092
+ return void 0;
1093
+ }
1094
+ return {
1095
+ name,
1096
+ email
1097
+ };
1098
+ };
1099
+
1100
+ export {
1101
+ detectLibc,
1102
+ platformCheck,
1103
+ pickManifest,
1104
+ spawn,
1105
+ revs,
1106
+ resolve,
1107
+ clone,
1108
+ is,
1109
+ isClean,
1110
+ getUser
1111
+ };