Skip to content

Commit

Permalink
Update src/Cake.Core/IO/FileExtensions.cs
Browse files Browse the repository at this point in the history
Co-authored-by: Mattias Karlsson <[email protected]>
  • Loading branch information
moljac and devlead authored Sep 29, 2023
1 parent 242c29d commit 0694bf2
Showing 1 changed file with 19 additions and 15 deletions.
34 changes: 19 additions & 15 deletions src/Cake.Core/IO/FileExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -116,22 +116,26 @@ public static bool IsClrAssembly(this IFile file)
return false;
}

if (file.Path != null
&&
!(
file.Path.FullPath.EndsWith(".dll") || file.Path.FullPath.EndsWith(".exe")
||
file.Path.FullPath.EndsWith(".sys") || file.Path.FullPath.EndsWith(".tsp")
||
file.Path.FullPath.EndsWith(".acm") || file.Path.FullPath.EndsWith(".ax")
||
file.Path.FullPath.EndsWith(".cpl") || file.Path.FullPath.EndsWith(".drv")
||
file.Path.FullPath.EndsWith(".efi") || file.Path.FullPath.EndsWith(".mui")
||
file.Path.FullPath.EndsWith(".ocx") || file.Path.FullPath.EndsWith(".scr")))
// Is known extension?
switch (file.Path?.GetExtension().ToLowerInvariant())
{
return false;
case "dll":
case "exe":
case "sys":
case "tsp":
case "acm":
case "ax":
case "cpl":
case "drv":
case "efi":
case "mui":
case "ocx":
case "scr":
case null:
break;

default:
return false;
}

using (var fs = file.OpenRead())
Expand Down

0 comments on commit 0694bf2

Please sign in to comment.