codewave-openclaw-installer 2.1.5 → 2.1.7
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/install-lib.mjs +7 -3
- package/bin/install.mjs +6 -2
- package/package.json +1 -1
package/bin/install-lib.mjs
CHANGED
|
@@ -41,7 +41,9 @@ export const CHANNEL_DEFINITIONS = {
|
|
|
41
41
|
join(homedir(), '.openclaw', 'extensions', 'openclaw-lark'),
|
|
42
42
|
],
|
|
43
43
|
envVars: ['LARK_APP_ID', 'LARK_APP_SECRET', 'FEISHU_APP_ID', 'FEISHU_APP_SECRET'],
|
|
44
|
-
installCommand:
|
|
44
|
+
installCommand: process.platform === 'win32'
|
|
45
|
+
? ['npx', ['-y', '"@larksuite/openclaw-lark"', 'install']]
|
|
46
|
+
: ['npx', ['-y', '@larksuite/openclaw-lark', 'install']],
|
|
45
47
|
initCandidates: [
|
|
46
48
|
['lark-cli', ['auth', 'login', '--recommend']],
|
|
47
49
|
],
|
|
@@ -71,7 +73,7 @@ export const CHANNEL_DEFINITIONS = {
|
|
|
71
73
|
? ['powershell', ['-Command', 'irm https://raw.githubusercontent.com/DingTalk-Real-AI/dingtalk-workspace-cli/main/scripts/install.ps1 | iex']]
|
|
72
74
|
: ['sh', ['-c', 'curl -fsSL https://raw.githubusercontent.com/DingTalk-Real-AI/dingtalk-workspace-cli/main/scripts/install.sh | sh']],
|
|
73
75
|
initCandidates: [
|
|
74
|
-
['dws', ['auth', 'login']],
|
|
76
|
+
['dws', ['auth', 'login', '--force']],
|
|
75
77
|
['dingtalk', ['auth', 'login']],
|
|
76
78
|
['dingtalk-workspace-cli', ['auth', 'login']],
|
|
77
79
|
],
|
|
@@ -92,7 +94,9 @@ export const CHANNEL_DEFINITIONS = {
|
|
|
92
94
|
desktopAppWindowsRegistryNames: ['企业微信', 'WeCom', 'WeChat Work'],
|
|
93
95
|
configPaths: [],
|
|
94
96
|
envVars: [],
|
|
95
|
-
installCommand:
|
|
97
|
+
installCommand: process.platform === 'win32'
|
|
98
|
+
? ['npx', ['-y', '"@wecom/cli"', 'init']]
|
|
99
|
+
: ['npx', ['-y', '@wecom/cli', 'init']],
|
|
96
100
|
initCandidates: [],
|
|
97
101
|
qrCandidates: [],
|
|
98
102
|
},
|
package/bin/install.mjs
CHANGED
|
@@ -49,6 +49,10 @@ function resolveExecutable(cmd) {
|
|
|
49
49
|
if (cmd === 'python3') return 'python.exe';
|
|
50
50
|
return cmd;
|
|
51
51
|
}
|
|
52
|
+
|
|
53
|
+
function shouldUseShell(executable) {
|
|
54
|
+
return isWin && /\.(cmd|bat)$/i.test(executable);
|
|
55
|
+
}
|
|
52
56
|
const WINDOWS_UNINSTALL_KEYS = [
|
|
53
57
|
'HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall',
|
|
54
58
|
'HKLM\\Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall',
|
|
@@ -69,7 +73,7 @@ function run(cmd, args, opts = {}) {
|
|
|
69
73
|
return Promise.resolve(0);
|
|
70
74
|
}
|
|
71
75
|
return new Promise((resolve) => {
|
|
72
|
-
const child = spawn(executable, args, { stdio: 'inherit', shell:
|
|
76
|
+
const child = spawn(executable, args, { stdio: 'inherit', shell: shouldUseShell(executable), ...opts });
|
|
73
77
|
child.on('close', (code) => resolve(code ?? 1));
|
|
74
78
|
child.on('error', (err) => {
|
|
75
79
|
console.log(yellow(` ⚠ 进程启动失败: ${err.message}`));
|
|
@@ -81,7 +85,7 @@ function run(cmd, args, opts = {}) {
|
|
|
81
85
|
function runCapture(cmd, args, opts = {}) {
|
|
82
86
|
const executable = resolveExecutable(cmd);
|
|
83
87
|
return new Promise((resolve) => {
|
|
84
|
-
const child = spawn(executable, args, { stdio: ['ignore', 'pipe', 'pipe'], shell:
|
|
88
|
+
const child = spawn(executable, args, { stdio: ['ignore', 'pipe', 'pipe'], shell: shouldUseShell(executable), ...opts });
|
|
85
89
|
let stdout = '';
|
|
86
90
|
let stderr = '';
|
|
87
91
|
child.stdout?.on('data', (chunk) => { stdout += chunk.toString(); });
|