-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to find the gcloud
command on Windows
#111
Comments
Do you want to try to revert #109 and see if that works for you? (I think if the removal of which is the cause, 0.12.0 should work for you since IIRC I only removed that in in 0.12.1.) |
Oh, indeed, I can see |
Right, I wasn't pinning |
I'm wondering, if you open a Command Prompt on Windows, can you successfully invoke Windows? I should probably also look at how which is implemented on Windows. |
I'm generally open to the idea of reverting the change that removed which but would like to understand why it's needed here. Maybe it could be a Windows-only dependency? |
It does work on the command line. It turns out the problem is not the path, but the executable name. The actual executable name on Windows is So, this makes it work: let mut command = Command::new("gcloud.cmd"); I think just moving the command name to OS specific variable should work: fn run(cmd: &[&str]) -> Result<String, Error> {
let mut command = Command::new(GCLOUD_CMD);
command.args(cmd);
...
}
...
#[cfg(any(target_os = "linux", target_os = "macos"))]
const GCLOUD_CMD: &str = "gcloud";
#[cfg(target_os = "windows")]
const GCLOUD_CMD: &str = "gcloud.cmd"; |
Sounds great, can you submit a PR? |
Created #113. Tested on Windows and MacOS. |
On
0.12.0
and0.12.1
,gcp_auth
is unable to find thecloud
command. This regression may be caused by the removal of thewhich
crate, which was being used to locate the command on0.11.1
, but is not used on0.12.0
and0.12.1
Log for `0.12.0`
Log for 0.11.1
The text was updated successfully, but these errors were encountered: