Skip to content

Commit

Permalink
fix dir finding
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonCropp committed Oct 1, 2023
1 parent 17beb8b commit aca8304
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
9 changes: 7 additions & 2 deletions src/Tests/NullabilitySync.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,13 @@
[TestFixture]
public class NullabilitySync
{
static string solutionDir = SolutionDirectoryFinder.Find();
static string dir = Path.Combine(solutionDir, "PolyFill", "Nullability");
static string dir;

static NullabilitySync()
{
var solutionDir = SolutionDirectoryFinder.Find();
dir = Path.Combine(solutionDir, "PolyFill", "Nullability");
}

[Test]
public async Task Run()
Expand Down
2 changes: 1 addition & 1 deletion src/Tests/SolutionDirectoryFinder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public static string Find([CallerFilePath] string sourceFile = "")

public static bool TryFind(string sourceFile, [NotNullWhen(true)] out string? path)
{
var currentDirectory = sourceFile;
var currentDirectory = Directory.GetParent(sourceFile)!.FullName;
do
{
if (Directory.GetFiles(currentDirectory, "*.sln").Any())
Expand Down

0 comments on commit aca8304

Please sign in to comment.