Skip to content

Command.Create should not transitively depend on hard coded paths #4592

@cdmihai

Description

@cdmihai

The resolution of commands depend on Directory.GetCurrentDirectory() and AppContext.BaseDirectory(). This introduces an implicit dependency between command resolution and the process that requests it (basedirectory) and the root process that spawned everything (getcurrentdirectory).

Instead, these paths should be variables resolved / injected at runtime.

This change enables:

  • decoupling command resolution from process identity
  • increased testability of the command resolution algorithm (can setup a fake environment and assert for resolution outcome)
  • calling verbs in-proc and out-of-proc

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions