endjin / dotnet-adr

A cross platform .NET Global Tool for creating and managing Architectural Decision Records (ADRs).
https://endjin.com
Apache License 2.0
86 stars 11 forks source link

Consider abstractions for filesystem actions #226

Closed nbarnwell closed 3 months ago

nbarnwell commented 4 months ago

I'm writing some tests for a new feature (https://github.com/endjin/dotnet-adr/issues/222) and understandably for a tool like this there's a lot of use of filesystem operations like Environment.CurrentDirectory. I'd like to replace these with abstractions (probably System.IO.Abstractions for actual filesystem related stuff) and will go ahead with that unless someone replies here telling me I'm wasting my time and that PR will never be considered. :)

HowardvanRooijen commented 4 months ago

Spectre.IO is already a dependency - I brought it in when I swapped from System.CommandLine to Spectre.Console to get a v1 out the door. Sounds like I missed some refactorings.

nbarnwell commented 4 months ago

Okay that's cool I'll look into that, then. I made a WorkingDirectory thing (Solutions/Endjin.Adr.Cli/Abstractions/WorkingDirectory.cs) to replace a couple of usages of Environment.CurrentDirectory but maybe Spectre.IO has something for that I can use instead. Thanks for the tip!