@wwkit/cft 1.0.30 → 1.0.31
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/LICENSE +20 -20
- package/README.md +67 -67
- package/bin/index.js +74 -74
- package/package.json +3 -3
- package/scripts/postinstall.js +49 -49
- package/src/config.js +54 -54
- package/src/config.json5 +4 -4
- package/src/depchecker.js +175 -175
- package/src/env.js +84 -84
- package/src/exefinder.js +109 -109
- package/src/index.js +3 -3
- package/src/installer.js +368 -368
- package/src/platform.js +31 -31
package/src/platform.js
CHANGED
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
import process from 'node:process'
|
|
2
|
-
import os from 'node:os'
|
|
3
|
-
|
|
4
|
-
const VALID_OS_TYPES = ['linux64', 'win64', 'mac-x64', 'mac-arm64']
|
|
5
|
-
|
|
6
|
-
export function getOs() {
|
|
7
|
-
const platform = process.platform
|
|
8
|
-
const arch = process.arch
|
|
9
|
-
if (platform === 'win32') return 'win64'
|
|
10
|
-
if (platform === 'darwin') return arch === 'arm64' ? 'mac-arm64' : 'mac-x64'
|
|
11
|
-
if (platform === 'linux') {
|
|
12
|
-
if (arch !== 'x64') {
|
|
13
|
-
throw new Error(`Chrome for Testing 不提供 linux-${arch} 构建(上游仅支持 linux64/x86_64)。请改用系统 Chromium:apt/dnf install chromium chromium-driver`)
|
|
14
|
-
}
|
|
15
|
-
return 'linux64'
|
|
16
|
-
}
|
|
17
|
-
throw new Error(`Unsupported platform: ${platform}`)
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
export function isWindows() {
|
|
21
|
-
return process.platform === 'win32'
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
export function isMacos() {
|
|
25
|
-
return process.platform === 'darwin'
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
export function isLinux() {
|
|
29
|
-
return process.platform === 'linux'
|
|
30
|
-
}
|
|
31
|
-
|
|
1
|
+
import process from 'node:process'
|
|
2
|
+
import os from 'node:os'
|
|
3
|
+
|
|
4
|
+
const VALID_OS_TYPES = ['linux64', 'win64', 'mac-x64', 'mac-arm64']
|
|
5
|
+
|
|
6
|
+
export function getOs() {
|
|
7
|
+
const platform = process.platform
|
|
8
|
+
const arch = process.arch
|
|
9
|
+
if (platform === 'win32') return 'win64'
|
|
10
|
+
if (platform === 'darwin') return arch === 'arm64' ? 'mac-arm64' : 'mac-x64'
|
|
11
|
+
if (platform === 'linux') {
|
|
12
|
+
if (arch !== 'x64') {
|
|
13
|
+
throw new Error(`Chrome for Testing 不提供 linux-${arch} 构建(上游仅支持 linux64/x86_64)。请改用系统 Chromium:apt/dnf install chromium chromium-driver`)
|
|
14
|
+
}
|
|
15
|
+
return 'linux64'
|
|
16
|
+
}
|
|
17
|
+
throw new Error(`Unsupported platform: ${platform}`)
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export function isWindows() {
|
|
21
|
+
return process.platform === 'win32'
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export function isMacos() {
|
|
25
|
+
return process.platform === 'darwin'
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export function isLinux() {
|
|
29
|
+
return process.platform === 'linux'
|
|
30
|
+
}
|
|
31
|
+
|
|
32
32
|
export { VALID_OS_TYPES }
|