1
1
/******/ (() => { // webpackBootstrap
2
2
/******/ var __webpack_modules__ = ({
3
3
4
+ /***/ 209:
5
+ /***/ ((__unused_webpack_module, exports) => {
6
+
7
+ "use strict";
8
+
9
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
10
+ function getArch() {
11
+ return process.arch;
12
+ }
13
+ exports["default"] = getArch;
14
+
15
+
16
+ /***/ }),
17
+
4
18
/***/ 951:
5
19
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
6
20
@@ -372,6 +386,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
372
386
Object.defineProperty(exports, "__esModule", ({ value: true }));
373
387
exports.getSystem = exports.OS = void 0;
374
388
const getos_1 = __importDefault(__nccwpck_require__(6068));
389
+ const arch_1 = __importDefault(__nccwpck_require__(209));
375
390
var OS;
376
391
(function (OS) {
377
392
OS[OS["MacOS"] = 0] = "MacOS";
@@ -395,23 +410,41 @@ async function getSystem() {
395
410
os ? resolve(os) : reject(error || "No OS detected");
396
411
});
397
412
});
413
+ const arch = (0, arch_1.default)();
398
414
let system;
399
415
switch (detectedSystem.os) {
400
416
case "darwin":
401
- system = { os: OS.MacOS, version: "latest", name: "macOS" };
417
+ system = {
418
+ os: OS.MacOS,
419
+ version: "latest",
420
+ name: "macOS",
421
+ arch,
422
+ };
402
423
break;
403
424
case "linux":
404
425
if (detectedSystem.dist !== "Ubuntu") {
405
- throw new Error(`"${detectedSystem.dist}" is not a supported linux distribution`);
426
+ throw new Error(`"${detectedSystem.dist}" is not a supported Linux distribution`);
427
+ }
428
+ if (arch !== "x64" && arch !== "arm64") {
429
+ throw new Error(`${arch} is not a supported architecture for Linux`);
406
430
}
407
431
system = {
408
432
os: OS.Ubuntu,
409
433
version: detectedSystem.release,
410
434
name: "Ubuntu",
435
+ arch,
411
436
};
412
437
break;
413
438
case "win32":
414
- system = { os: OS.Windows, version: "latest", name: "Windows" };
439
+ if (arch !== "x64") {
440
+ throw new Error(`${arch} is not a supported architecture for Windows`);
441
+ }
442
+ system = {
443
+ os: OS.Windows,
444
+ version: "latest",
445
+ name: "Windows",
446
+ arch,
447
+ };
415
448
break;
416
449
default:
417
450
throw new Error(`"${detectedSystem.os}" is not a supported platform`);
@@ -542,7 +575,11 @@ function swiftPackage(version, system) {
542
575
break;
543
576
case os_1.OS.Ubuntu:
544
577
platform = `ubuntu${system.version.replace(/\D/g, "")}`;
578
+ if (system.arch === "arm64")
579
+ platform += "-aarch64";
545
580
archiveName = `swift-${version}-RELEASE-ubuntu${system.version}`;
581
+ if (system.arch === "arm64")
582
+ archiveName += "-aarch64";
546
583
archiveFile = `${archiveName}.tar.gz`;
547
584
break;
548
585
case os_1.OS.Windows:
0 commit comments