Checking for 'func' command works on MacOS too - #14
Merged
Conversation
mark-abrams
previously approved these changes
May 18, 2023
mark-abrams
left a comment
Collaborator
There was a problem hiding this comment.
Thanks for the contribution. I've only used the framework on a Windows OS, so it is good to see that someone is using on a MacOS. Have you run into any other problems or issues when using the testing framework on MacOS?
mark-abrams
approved these changes
May 29, 2023
Contributor
Author
|
Thanks for accepting the PR. I haven't came across any other issues, but will keep you posted. Cheers. |
Collaborator
|
Hi @eashi , I have uploaded version 1.6.0 of LogicAppUnit to Nuget. This includes your changes in PR #14 and also PR #15 for support for the MacOS platform. Thank you for your contribution. |
Contributor
Author
|
This is great news, thanks Mark for the great project and active maintenance. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR changes the code that checks for the
funccommand in PATH so that it works on both Windows and MacOS.The current code only works on Windows:
Path.PathSeparatorrather than hard-coding a semicolon or a colon. For more information check: https://learn.microsoft.com/en-us/dotnet/api/system.io.path.pathseparator?view=net-7.0funchas the extension suffix.exe. This is true on Windows, but not on MacOS. This PR searches for both cases to support both Windows and MacOS.Environment.GetEnvironmentVariable("PATH", EnvironmentVariableTarget.Machine)returns null because the option passedEnvironmentVariableTarget.Machinefails on MacOS. Removing the option fixes it and shouldn't cause any unexpected behaviours. For more infomration check https://learn.microsoft.com/en-us/dotnet/api/system.environment.getenvironmentvariable?view=net-7.0