Skip to content

Commit 2928143

Browse files
committed
slightly nicer way of finding the package directory
1 parent f19a78b commit 2928143

File tree

1 file changed

+3
-4
lines changed
  • Test.Microsoft.NET.Build.Containers.Filesystem

1 file changed

+3
-4
lines changed

Test.Microsoft.NET.Build.Containers.Filesystem/EndToEnd.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -146,10 +146,9 @@ public async Task EndToEnd_NoAPI()
146146
var repoGlobalJson = Path.Combine("..", "..", "..", "..", "global.json");
147147
File.Copy(repoGlobalJson, Path.Combine(newProjectDir.FullName, "global.json"));
148148

149+
var packagedir = new DirectoryInfo(CurrentFile.Relative("./package"));
149150
// 🤢
150-
DirectoryInfo nupkgPath = new DirectoryInfo(Assembly.GetAssembly(this.GetType()).Location).Parent.Parent.Parent;
151-
nupkgPath = nupkgPath.GetDirectories("package")[0];
152-
FileInfo[] nupkgs = nupkgPath.GetFiles("*.nupkg");
151+
FileInfo[] nupkgs = packagedir.GetFiles("*.nupkg");
153152
if (nupkgs == null || nupkgs.Length == 0)
154153
{
155154
// Build Microsoft.NET.Build.Containers.csproj & wait.
@@ -182,7 +181,7 @@ public async Task EndToEnd_NoAPI()
182181
await dotnetNewNugetConfig.WaitForExitAsync();
183182
Assert.AreEqual(0, dotnetNewNugetConfig.ExitCode);
184183

185-
info.Arguments = $"nuget add source {nupkgPath.FullName} --name local-temp";
184+
info.Arguments = $"nuget add source {packagedir.FullName} --name local-temp";
186185

187186
// Set up temp folder as "nuget feed"
188187
Process dotnetNugetAddSource = Process.Start(info);

0 commit comments

Comments
 (0)