sakitamanler-ccl-launcher 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/bin/ccl +8 -9
- package/package.json +1 -1
package/bin/ccl
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
const { spawn } = require('child_process');
|
|
4
4
|
const process = require('process');
|
|
5
|
+
const path = require('path');
|
|
5
6
|
|
|
6
7
|
// 根据平台和架构确定要执行的命令
|
|
7
8
|
function getTargetCommand() {
|
|
@@ -16,7 +17,10 @@ function getTargetCommand() {
|
|
|
16
17
|
case 'linux-x64':
|
|
17
18
|
return 'ccl-linux-x64';
|
|
18
19
|
case 'win32-x64':
|
|
19
|
-
|
|
20
|
+
// Windows 下直接使用 ccl.exe
|
|
21
|
+
const pkgPath = path.join(__dirname, '..', 'node_modules', 'sakitamanler-ccl-win32');
|
|
22
|
+
const exePath = path.join(pkgPath, 'ccl.exe');
|
|
23
|
+
return exePath;
|
|
20
24
|
default:
|
|
21
25
|
throw new Error(`Unsupported platform: ${platform}-${arch}`);
|
|
22
26
|
}
|
|
@@ -53,15 +57,10 @@ function executeTargetCommand() {
|
|
|
53
57
|
let child;
|
|
54
58
|
// Windows 平台特殊处理
|
|
55
59
|
if (process.platform === 'win32') {
|
|
56
|
-
//
|
|
57
|
-
|
|
58
|
-
command,
|
|
59
|
-
...args.map(a => `"${a.replace(/"/g, '\\"')}"`)
|
|
60
|
-
].join(' ');
|
|
61
|
-
|
|
62
|
-
child = spawn(fullCommand, {
|
|
60
|
+
// Windows 下直接执行 ccl.exe
|
|
61
|
+
child = spawn(command, args, {
|
|
63
62
|
stdio: 'inherit',
|
|
64
|
-
shell:
|
|
63
|
+
shell: false
|
|
65
64
|
});
|
|
66
65
|
} else {
|
|
67
66
|
child = spawn(command, args, {
|