mirror of
https://github.com/tiennm99/ccs.git
synced 2026-07-17 08:17:22 +00:00
fix(websearch): use 'where' command on Windows for CLI detection
Fixes #273 The websearch-transformer hook used hardcoded 'which' command which doesn't exist on Windows. Now uses process.platform detection to choose 'where' on Windows and 'which' on Unix systems.
This commit is contained in:
@@ -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