[fix] 修复ExistProgram在非Windows平台无法返回正确结果的问题

linux和OSX中并没有where命令
main
lizhou.zhu 2022-09-27 16:47:46 +08:00
parent 62bf4c2847
commit dea7351771
1 changed files with 5 additions and 0 deletions

View File

@ -52,7 +52,12 @@ namespace HybridCLR.Editor.Installer
public static bool ExistProgram(string prog) public static bool ExistProgram(string prog)
{ {
#if UNITY_EDITOR_WIN
return RunCommand(".", "where", new string[] {prog}) == 0; return RunCommand(".", "where", new string[] {prog}) == 0;
#elif UNITY_EDITOR_OSX || UNITY_EDITOR_LINUX
return RunCommand(".", "which", new string[] {prog}) == 0;
#endif
return false;
} }