mirror of
https://github.com/tiennm99/ccs.git
synced 2026-10-13 22:15:33 +00:00
Merge pull request #274 from kaitranntt/fix/websearch-hook-windows-compat
fix(websearch): use 'where' command on Windows for CLI detection
This commit is contained in:
1 file changed
+4
-1
@@ -154,7 +154,10 @@ process.stdin.on('error', () => {
|
||||
*/
|
||||
function isCliAvailable(cmd) {
|
||||
try {
|
||||
const result = spawnSync('which', [cmd], {
|
||||
const isWindows = process.platform === 'win32';
|
||||
const whichCmd = isWindows ? 'where.exe' : 'which';
|
||||
|
||||
const result = spawnSync(whichCmd, [cmd], {
|
||||
encoding: 'utf8',
|
||||
timeout: 2000,
|
||||
stdio: ['pipe', 'pipe', 'pipe'],
|
||||
|
||||
Reference in new issue
Block a user