Check whether the glogin command exists before running it.
@@ -62,7 +62,11 @@ public final class FileGitHubIssueAction extends BlazeProjectAction {
private static final NotNullLazyValue<Boolean> isCorpMachine =
NotNullLazyValue.createValue(
() -> {
- int retVal = ExternalTask.builder().args("glogin", "-version").build().run();
+ String which = SystemInfo.isWindows ? "where" : "which";
+ int retVal = ExternalTask.builder().args(which, "glogin").build().run();
+ if (retVal == 0) {
+ retVal = ExternalTask.builder().args("glogin", "-version").build().run();
+ }
return retVal == 0;
});
