mafit 1.0.1 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin/mafit.cjs +13 -8
- package/package.json +1 -1
package/dist/bin/mafit.cjs
CHANGED
|
@@ -11,33 +11,37 @@ const binaryByPlatform = {
|
|
|
11
11
|
"id": "linux-x64",
|
|
12
12
|
"platform": "linux",
|
|
13
13
|
"arch": "x64",
|
|
14
|
-
"filename": "mafit-linux-x64"
|
|
14
|
+
"filename": "mafit-linux-x64",
|
|
15
|
+
"downloadFilename": "mafit-linux-x64"
|
|
15
16
|
},
|
|
16
17
|
"darwin-x64": {
|
|
17
18
|
"id": "darwin-x64",
|
|
18
19
|
"platform": "darwin",
|
|
19
20
|
"arch": "x64",
|
|
20
|
-
"filename": "mafit-darwin-x64"
|
|
21
|
+
"filename": "mafit-darwin-x64",
|
|
22
|
+
"downloadFilename": "mafit-darwin-x64"
|
|
21
23
|
},
|
|
22
24
|
"darwin-arm64": {
|
|
23
25
|
"id": "darwin-arm64",
|
|
24
26
|
"platform": "darwin",
|
|
25
27
|
"arch": "arm64",
|
|
26
|
-
"filename": "mafit-darwin-arm64"
|
|
28
|
+
"filename": "mafit-darwin-arm64",
|
|
29
|
+
"downloadFilename": "mafit-darwin-arm64"
|
|
27
30
|
},
|
|
28
31
|
"win32-x64": {
|
|
29
32
|
"id": "win32-x64",
|
|
30
33
|
"platform": "win32",
|
|
31
34
|
"arch": "x64",
|
|
32
|
-
"filename": "mafit-win32-x64.exe"
|
|
35
|
+
"filename": "mafit-win32-x64.exe",
|
|
36
|
+
"downloadFilename": "mafit-win32-x64.bin"
|
|
33
37
|
}
|
|
34
38
|
};
|
|
35
39
|
const fallbackByPlatform = {
|
|
36
40
|
"win32-arm64": "win32-x64"
|
|
37
41
|
};
|
|
38
|
-
const version = "1.0.
|
|
39
|
-
const binaryVersion = "1.0.
|
|
40
|
-
const defaultUrlTemplate = "https://cdn.jsdelivr.net/npm/mafit@{binaryVersion}/dist/bin/{
|
|
42
|
+
const version = "1.0.2";
|
|
43
|
+
const binaryVersion = "1.0.2-bin.0";
|
|
44
|
+
const defaultUrlTemplate = "https://cdn.jsdelivr.net/npm/mafit@{binaryVersion}/dist/bin/{downloadFilename}";
|
|
41
45
|
const key = `${process.platform}-${process.arch}`;
|
|
42
46
|
const resolvedKey = binaryByPlatform[key] ? key : (fallbackByPlatform[key] || "");
|
|
43
47
|
const target = binaryByPlatform[resolvedKey];
|
|
@@ -74,7 +78,8 @@ const applyTemplate = (template) =>
|
|
|
74
78
|
.replaceAll("{id}", target.id)
|
|
75
79
|
.replaceAll("{platform}", target.platform)
|
|
76
80
|
.replaceAll("{arch}", target.arch)
|
|
77
|
-
.replaceAll("{filename}", target.filename)
|
|
81
|
+
.replaceAll("{filename}", target.filename)
|
|
82
|
+
.replaceAll("{downloadFilename}", target.downloadFilename || target.filename);
|
|
78
83
|
|
|
79
84
|
const urlTemplate = process.env.MAFIT_BINARY_URL_TEMPLATE || defaultUrlTemplate;
|
|
80
85
|
const downloadUrl = applyTemplate(urlTemplate);
|