@simonyea/holysheep-cli 1.3.3 → 1.3.5
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/package.json +1 -1
- package/src/tools/openclaw.js +10 -6
package/package.json
CHANGED
package/src/tools/openclaw.js
CHANGED
|
@@ -136,12 +136,16 @@ module.exports = {
|
|
|
136
136
|
*/
|
|
137
137
|
function _startGateway() {
|
|
138
138
|
if (isWin) {
|
|
139
|
-
// Windows:
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
139
|
+
// Windows: 用 WScript.Shell 后台静默运行,不弹窗口,最可靠
|
|
140
|
+
const vbs = `
|
|
141
|
+
Set sh = CreateObject("WScript.Shell")
|
|
142
|
+
sh.Run "cmd /c npx openclaw gateway --port 18789", 0, False
|
|
143
|
+
`.trim()
|
|
144
|
+
const vbsPath = path.join(os.tmpdir(), 'openclaw-gateway.vbs')
|
|
145
|
+
try {
|
|
146
|
+
fs.writeFileSync(vbsPath, vbs, 'utf8')
|
|
147
|
+
spawnSync('wscript', [vbsPath], { shell: false, timeout: 5000, stdio: 'ignore' })
|
|
148
|
+
} catch {}
|
|
145
149
|
} else {
|
|
146
150
|
const child = spawn('openclaw', ['gateway', '--port', '18789'], {
|
|
147
151
|
detached: true,
|