andrewabest/Conventional

KnownPaths solution-root finding is broken on Linux/OSX

flakey-bit opened this issue · 1 comments

Running the tests on a Linux build agent/container fails to find the solution root due to hard-coded use of backslash as the directory separator.

  • For DefaultSolutionRootFinder we could use $"{Path.DirectorySeparatorChar}bin{Path.DirectorySeparatorChar}".
    • Alternatively, could do a string split on Path.DirectorySeparatorChar then Path.Combine the parts up to but not including the last occurrence of bin
  • For DefaultSolutionRoot we could use Directory.GetParent(KnownPaths.SolutionRootFinder(AppContext.BaseDirectory)).FullName

The KnownPaths.SolutionRoot setter is also problematic because it "helpfully" adds a trailing backslash if there isn't one, meaning I can't even work around this issue by setting KnownPaths.SolutionRoot manually.

Howdy Eddie!

Yes this is a problem that I've known for a little while - when I ported Conventional to Core I didn't take the time to cross-platform it 😢

Your suggestions sound good - I'm happy to either work these in at my next available slot, or accept a PR.

It would probably be a good time for me to ensure the tests run on both Windows and Linux agents too, although I'd need to see what AppVeyor has to support this.