mirror of
https://github.com/qingchencloud/clawpanel.git
synced 2026-05-06 20:02:49 +08:00
fix: 支持自定义 npm global 路径的 CLI 检测
- Linux 下使用 which 命令动态查找 openclaw - 支持用户自定义 npm prefix 配置 - 修复 Issue #6 Closes #6
This commit is contained in:
@@ -283,10 +283,13 @@ const handlers = {
|
||||
try { cliInstalled = fs.existsSync(path.join(process.env.APPDATA || '', 'npm', 'openclaw.cmd')) }
|
||||
catch { cliInstalled = false }
|
||||
} else {
|
||||
// Linux
|
||||
cliInstalled = fs.existsSync('/usr/bin/openclaw') ||
|
||||
fs.existsSync('/usr/local/bin/openclaw') ||
|
||||
fs.existsSync(path.join(homedir(), '.openclaw/bin/openclaw'))
|
||||
// Linux - 使用 which 命令动态查找
|
||||
try {
|
||||
execSync('which openclaw', { stdio: 'pipe' })
|
||||
cliInstalled = true
|
||||
} catch {
|
||||
cliInstalled = false
|
||||
}
|
||||
}
|
||||
|
||||
return [{ label, running, pid, description: 'OpenClaw Gateway', cli_installed: cliInstalled }]
|
||||
|
||||
Reference in New Issue
Block a user