Skip to content

Commit

Permalink
nit: leave symbolic links untouched for now
Browse files Browse the repository at this point in the history
  • Loading branch information
grvillic committed Nov 17, 2024
1 parent 0a8d2b5 commit 16cf57a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ private HashSet<string> MakeFilePathsRelative(ILogger logger, DirectoryInfo root
try
{
var relativePath = rootUri.MakeRelativeUri(new Uri(path)).ToString();
if (!relativePath.StartsWith('/') && !relativePath.Contains(':', StringComparison.CurrentCultureIgnoreCase))
if (!relativePath.StartsWith('/'))
{
relativePath = "/" + relativePath;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,8 @@ public void GenerateScanResultFromResult_WithCustomLocations_WithExperimentsDryR
var resultNpmComponent = result.ComponentsFound.Single(c => c.Component.Type == ComponentType.Npm);
var resultNugetComponent = result.ComponentsFound.Single(c => c.Component.Type == ComponentType.NuGet);

resultNpmComponent.LocationsFoundAt.Should().BeEquivalentTo([npmCustomPath, detectedFilePath, relatedFilePath, npmCustomPath2]);
// for now there is a bug that adds a forward slash to the path for symbolic links. This will be fixed in a future PR if we can parse dependency graph better for those.
resultNpmComponent.LocationsFoundAt.Should().BeEquivalentTo([npmCustomPath, detectedFilePath, relatedFilePath, $"/{npmCustomPath2}"]);
resultNugetComponent.LocationsFoundAt.Should().BeEquivalentTo([nugetCustomPath, detectedFilePath, relatedFilePath]);

var actualNpmComponent = resultNpmComponent.Component as NpmComponent;
Expand Down

0 comments on commit 16cf57a

Please sign in to comment.