Skip to content

Commit

Permalink
Merge pull request #20 from Codesee-io/ENG-2603-net5-build-path-safety
Browse files Browse the repository at this point in the history
ENG-2603 Make sure the output path exists.
  • Loading branch information
mkestler-rtp authored Mar 13, 2023
2 parents 4f9317d + c059487 commit 5b46d45
Showing 1 changed file with 17 additions and 14 deletions.
31 changes: 17 additions & 14 deletions DotNETDepends/PublishedWebProject.cs
Original file line number Diff line number Diff line change
Expand Up @@ -110,26 +110,29 @@ private void ReadProjectFile(IErrorReporter errorReporter)
if (project.FilePath != null && assemblyName != null)
{
var binRoot = Path.Combine(new string[] { Path.GetDirectoryName(project.FilePath)?? "", "bin", config });
DirectoryInfo dirInfo = new(binRoot);
var dirs = dirInfo.GetDirectories();
string? assemPath = null;
if (dirs.Length == 1)
if (Path.Exists(binRoot))
{
assemPath = Path.Combine(new string[] { binRoot, dirs[0].Name, runtime, "publish", assemblyName });
if (File.Exists(assemPath))
DirectoryInfo dirInfo = new(binRoot);
var dirs = dirInfo.GetDirectories();
string? assemPath = null;
if (dirs.Length == 1)
{
return assemPath;
assemPath = Path.Combine(new string[] { binRoot, dirs[0].Name, runtime, "publish", assemblyName });
if (File.Exists(assemPath))
{
return assemPath;
}
assemPath = Path.Combine(new string[] { binRoot, dirs[0].Name, runtime, assemblyName });
if (File.Exists(assemPath))
{
return assemPath;
}
assemPath = Path.Combine(new string[] { binRoot, dirs[0].Name, assemblyName });
}
assemPath = Path.Combine(new string[] { binRoot, dirs[0].Name, runtime, assemblyName });
if (File.Exists(assemPath))
if (assemPath != null && File.Exists(assemPath))
{
return assemPath;
}
assemPath = Path.Combine(new string[] { binRoot, dirs[0].Name, assemblyName });
}
if (assemPath != null && File.Exists(assemPath))
{
return assemPath;
}
}
return null;
Expand Down

0 comments on commit 5b46d45

Please sign in to comment.