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:
kaitranntt
2026-01-05 12:38:01 -05:00
parent 3a40a0d015
commit e03d9b7743
+4 -1
View File
@@ -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'],