Skip to content
Permalink
Browse files
fix: fix gcloud SDK detection on Windows (#384)
Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:
- [x] Make sure to open an issue as a [bug/issue](https://github.com/googleapis/java-core/issues/new/choose) before writing your code!  That way we can discuss the change, evaluate designs, and agree on the general idea
- [x] Ensure the tests and linter pass
- [x] Code coverage does not decrease (if any source code was changed)
- [ ] Appropriate docs were updated (if necessary)

Fixes #383
  • Loading branch information
kevin-wise committed Feb 24, 2021
1 parent 82840da commit 9545442906b21897c5227fecf8efd264d7c2d84c
Showing with 2 additions and 8 deletions.
  1. +2 −8 google-cloud-core/src/main/java/com/google/cloud/testing/BaseEmulatorHelper.java
@@ -47,7 +47,6 @@
import java.util.Arrays;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.concurrent.Callable;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.TimeUnit;
@@ -275,13 +274,8 @@ public Process getProcess() {
}

private boolean isGcloudInstalled() {
Map<String, String> env = System.getenv();
for (String envName : env.keySet()) {
if ("PATH".equals(envName)) {
return env.get(envName).contains("google-cloud-sdk");
}
}
return false;
String path = System.getenv("PATH");
return path != null && path.contains("google-cloud-sdk");
}

private boolean isEmulatorUpToDate() throws IOException, InterruptedException {

0 comments on commit 9545442

Please sign in to comment.