Skip to content
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

check file paths for probed environment variables for existence #190

Merged
merged 1 commit into from
May 10, 2023

Conversation

baronfel
Copy link
Collaborator

@baronfel baronfel commented May 10, 2023

WHAT

🤖 Generated by Copilot at 8704a72

The pull request updates the dotnet-tools.json file to use the latest tools and adds a new function checkExistence to the Utils.fs file to simplify file existence checks. These changes enhance the project's reliability and code quality.

🤖 Generated by Copilot at 8704a72

Oh we're the merry coders of the F# crew
We update our tools and refactor too
We use checkExistence to make our code neat
And we heave away on the count of three

⬆️🔧♻️

WHY

Fixes a validation gap described in ionide/FsAutoComplete#1014 (comment) - we check PATH and the 'default' locations for the existence of the actual dotnet binary, we should do the same for the paths inferred from environment variables. This makes users in mixed-mode scenarios less likely to experience errors.

HOW

🤖 Generated by Copilot at 8704a72

  • Updated the versions of paket and fantomas tools in the .config/dotnet-tools.json file to use the latest and stable releases (link, link)
  • Added a new function checkExistence to the Paths module in the src/Ionide.ProjInfo/Utils.fs file to simplify the logic of checking file existence (link)
  • Refactored the logic of three functions in the Paths module (<private>, <private>, and tryFindFile) to use the checkExistence function instead of directly checking the Exists property of the FileInfo object, to avoid code duplication and improve readability (link, link, link)

@baronfel baronfel merged commit 963dc87 into main May 10, 2023
@baronfel baronfel deleted the test-env-var-paths branch May 10, 2023 16:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants