mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-08-05 06:42:12 +03:00
fix(cli): guard against empty where output on Windows
This commit is contained in:
@@ -544,6 +544,9 @@ const locateCommand = async (command: string, env: Record<string, string | undef
|
||||
.split(/\r?\n/)
|
||||
.map((l) => l.trim())
|
||||
.filter(Boolean);
|
||||
if (lines.length === 0) {
|
||||
return { installed: false, commandPath: null, reason: "not_found" };
|
||||
}
|
||||
const winExt = /\.(cmd|exe|bat|com)$/i;
|
||||
const preferred = lines.find((l) => winExt.test(l)) || lines[0];
|
||||
return { installed: true, commandPath: preferred, reason: null };
|
||||
|
||||
Reference in New Issue
Block a user