Skip to content
Prev Previous commit
Next Next commit
Simplify dir handling
  • Loading branch information
agocke authored and github-actions committed Jun 3, 2025
commit c2f5e15e40bc8365ea476a276c675d33cfbf8ed6
8 changes: 4 additions & 4 deletions src/installer/tests/HostActivation.Tests/SymbolicLinks.cs
Original file line number Diff line number Diff line change
Expand Up @@ -92,23 +92,23 @@ public void Symlink_split_files_fx(string symlinkRelativePath)
}

// Symlink all of the above into a single directory
var targetPath = Path.Combine(testDir.Location, Path.GetDirectoryName(symlinkRelativePath));
var targetPath = Path.Combine(testDir.Location, symlinkRelativePath);
Directory.CreateDirectory(targetPath);
var symlinks = new List<SymLink>();
try
{
foreach (var file in Directory.EnumerateFiles(appFilesDir))
{
var fileName = Path.GetFileName(file);
var symlinkPath = Path.Combine(targetPath, symlinkRelativePath, fileName);
var symlinkPath = Path.Combine(targetPath, fileName);
Directory.CreateDirectory(Path.GetDirectoryName(symlinkPath));
symlinks.Add(new SymLink(file, symlinkPath));
}
symlinks.Add(new SymLink(
Path.Combine(appHostDir, Path.GetFileName(sharedTestState.FrameworkDependentApp.AppExe)),
Path.Combine(targetPath, symlinkRelativePath, Path.GetFileName(sharedTestState.FrameworkDependentApp.AppExe))));
Path.Combine(targetPath, Path.GetFileName(sharedTestState.FrameworkDependentApp.AppExe))));

var result = Command.Create(Path.Combine(testDir.Location, symlinkRelativePath, Path.GetFileName(sharedTestState.FrameworkDependentApp.AppExe)))
var result = Command.Create(Path.Combine(targetPath, Path.GetFileName(sharedTestState.FrameworkDependentApp.AppExe)))
.CaptureStdErr()
.CaptureStdOut()
.DotNetRoot(TestContext.BuiltDotNet.BinPath)
Expand Down