Repository navigation
Resolve a relative executable path against WorkingDirectory [patch] - #131
Merged
matt-edmondson merged 1 commit intoNov 4, 2026
Conversation
Process.Start resolves a relative FileName against the caller's current directory, so ./build.sh with WorkingDirectory set ran the caller's copy or failed to start. Combine a relative path that has a directory part with the working directory; bare names keep the usual search and absolute paths are unchanged. Fixes #115 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017vfJW5RZNbz1MNkbtrM9Bn
|
matt-edmondson
deleted the
fix/115-resolve-relative-executable-against-working-directory
branch
November 4, 2026 00:54
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.



Fixes #115
Summary
Process.Startresolves a relativeFileNameagainst the calling process's current directory, not againstProcessStartInfo.WorkingDirectory. SoExecuteAsync("./build.sh", …, new() { WorkingDirectory = repo })ran whicheverbuild.shwas in the caller's current directory. If there was none, it failed with an error that named the directory that did contain the script.CreateStartInfonow passes the file name through a newResolveFileNamebefore starting the process. When aWorkingDirectoryis set and the file name is relative with a directory part, it is resolved againstWorkingDirectory. Examples are./xandsub/x, plus.\xon Windows. This matchescd repo && ./build.shin a shell.git,dotnet) keep the usual search.WorkingDirectory, nothing changes.The README's Working Directory section now states these rules.
Tests
ExecuteAsyncShouldResolveARelativeExecutablePathAgainstTheWorkingDirectory, with./scriptandsub/scriptcases. It puts a same-named script in both the working directory and the caller's current directory, then asserts that the working directory's copy ran. It writes.cmdscripts on Windows and.shelsewhere.dotnet build RunCommand.slnis clean for every target framework. Full suite: 66 passed, 0 failed, 2 skipped (the Windows-only tests).Generated by Claude Code