Skip to content

fix: validate dotnet path exists before returning from TryFindDotNetExePath#607

Merged
natemcmaster merged 2 commits intomainfrom
claude/issue-600-20260405-0456
Apr 5, 2026
Merged

fix: validate dotnet path exists before returning from TryFindDotNetExePath#607
natemcmaster merged 2 commits intomainfrom
claude/issue-600-20260405-0456

Conversation

@natemcmaster
Copy link
Copy Markdown
Owner

Fixes #600

TryFindDotNetExePath() was always returning a constructed path even when the file didn't exist (e.g., /usr/local/share/dotnet/dotnet on Alpine). This prevented FullPathOrDefault() from falling back to just "dotnet".

Added File.Exists check and tests covering exists/not-exists scenarios.

Generated with Claude Code

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 5, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 80.01%. Comparing base (86afb38) to head (637cf90).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #607   +/-   ##
=======================================
  Coverage   80.00%   80.01%           
=======================================
  Files         120      120           
  Lines        4061     4063    +2     
  Branches      879      880    +1     
=======================================
+ Hits         3249     3251    +2     
+ Misses        623      622    -1     
- Partials      189      190    +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

github-actions bot and others added 2 commits April 4, 2026 22:49
…xePath

TryFindDotNetExePath() was always returning a constructed path even when
the file didn't exist (e.g., /usr/local/share/dotnet/dotnet on Alpine).
This prevented FullPathOrDefault() from falling back to just "dotnet".

Added File.Exists check and extracted FindDotNetInRoot as an internal
method for testability. Added tests covering exists/not-exists scenarios.

Fixes #600

Co-authored-by: Nate McMaster <natemcmaster@users.noreply.github.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@natemcmaster natemcmaster force-pushed the claude/issue-600-20260405-0456 branch from d191a2b to 637cf90 Compare April 5, 2026 05:49
@claude
Copy link
Copy Markdown

claude bot commented Apr 5, 2026

Claude finished @natemcmaster's task in 27s —— View job


Code Review for PR #607

  • Read review instructions
  • Gather context and review changes
  • Post review feedback

Looks good! The fix is clean and correct — extracting the File.Exists check into FindDotNetInRoot is a nice way to make it testable while keeping the logic simple.

Tests cover the key scenarios (file exists, file doesn't exist, directory doesn't exist) and the FullPathOrDefaultReturnsPathOrDotnet test validates the end-to-end behavior.

No issues found.

@natemcmaster natemcmaster merged commit 33b59d7 into main Apr 5, 2026
8 checks passed
@natemcmaster natemcmaster deleted the claude/issue-600-20260405-0456 branch April 5, 2026 05:51
This was referenced Apr 5, 2026
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.

DotNetExe FullPathOrDefaultis returning invalid path

1 participant