1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-23 01:44:22 +00:00

Linux: Use return code of which to determine whether executable is available instead of parsing output

This commit is contained in:
ed 2020-07-28 11:16:11 +01:00
parent a3af3a5381
commit c73d215cc0

View file

@ -32,16 +32,13 @@ static bool exeIsAvailable (String executable)
if (child.start ("which " + executable))
{
auto output = child.readAllProcessOutput().trim();
child.waitForProcessToFinish (60 * 1000);
return output.isNotEmpty() && ! output.contains ("no " + executable);
return (child.getExitCode() == 0);
}
return false;
}
class FileChooser::Native : public FileChooser::Pimpl,
private Timer
{