Skip to content

Commit 643abf4

Browse files
committed
improve find_cli to use command -v instead of which
1 parent 51ae165 commit 643abf4

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

.changeset/bold-ghosts-notice.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@fuzdev/gro': patch
3+
---
4+
5+
improve `find_cli` to use `command -v` instead of `which`

src/lib/cli.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ export const find_cli = async (
3535
if (await fs_exists(local_id)) {
3636
return {name, id: local_id, kind: 'local'};
3737
}
38-
const {stdout} = await spawn_out('which', [name], options);
38+
const {stdout} = await spawn_out('sh', ['-c', 'command -v "$1"', 'sh', name], options);
3939
const global_id = stdout?.trim();
4040
if (!global_id) return null;
4141
return {name, id: global_id, kind: 'global'};

0 commit comments

Comments
 (0)