-
Notifications
You must be signed in to change notification settings - Fork 47
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
CLI-1171: acli throws error in Windows terminal #1610
Comments
Could you please confirm you're on the latest version of Acquia CLI (should be 2.16.0)?
|
I'm getting the same error on every |
Thank you, that's helpful. @danepowell for awareness. Looks like #1605 doesn't directly help. |
Thanks, this is unrelated to #1605 despite being the same environment and error class. |
I cannot reproduce this in Windows 11 stock versions of CMD and PowerShell because MSYSTEM is not set. How is that variable set in your environment? Are you using msys2 perhaps? |
@danepowell , I don't have it set either, that env variable simply does not exist. Hence getenv('MSYSTEM') call returns false and condition |
Right, I can reproduce this now on vanilla CMD. I got my wires crossed, sorry for the noise! |
PR looks good, just needs tests (see my comment there). I also opened an upstream report, since we borrowed this code from Terminus long ago: pantheon-systems/terminus#2509 |
Describe the bug
Incorrect condition at
cli/src/Helpers/LocalMachineHelper.php
Line 226 in 23d3e32
getenv() returns null only if the respective variable is present and contains NULL as a value: https://www.php.net/manual/en/function.getenv.php . If variable doesn't exist getenv() returns FALSE instead. In that case condition currently evaluates as TRUE and substr() on the next line throws error when called as substr(FALSE, 0, 4)
Proposed solution
Update business logic to add additional condition to line#226:
or just
Screenshots
Output including error stack trace:
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: