Skip to content

Commit

Permalink
#6664 Update ClearPluginAssemblies to .NET 8
Browse files Browse the repository at this point in the history
  • Loading branch information
DmitriyKulagin committed Dec 6, 2023
1 parent 00d27c1 commit 15f248d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<ApplicationIcon />
<StartupObject />
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>


Expand Down
14 changes: 5 additions & 9 deletions src/Build/src/ClearPluginAssemblies/Program.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
using System.Collections.Generic;
using System.IO;
using System.Linq;

namespace ClearPluginAssemblies
namespace ClearPluginAssemblies
{
public class Program
{
Expand Down Expand Up @@ -42,7 +38,7 @@ protected static void Clear(string paths, IList<string> fileNames, bool saveLoca
File.Delete(pdbfilePath);
}

if (!directoryInfo.GetFiles().Any() && !directoryInfo.GetDirectories().Any() && !saveLocalesFolders)
if (directoryInfo.GetFiles().Length == 0 && directoryInfo.GetDirectories().Length == 0 && !saveLocalesFolders)
directoryInfo.Delete(true);
}
}
Expand All @@ -59,7 +55,7 @@ private static void Main(string[] args)
var pluginPaths = string.Empty;
var saveLocalesFolders = true;

var settings = args.FirstOrDefault(a => a.Contains("|")) ?? string.Empty;
var settings = args.FirstOrDefault(a => a.Contains('|')) ?? string.Empty;
if(string.IsNullOrEmpty(settings))
return;

Expand All @@ -79,7 +75,7 @@ private static void Main(string[] args)
pluginPaths = value;
break;
case "SaveLocalesFolders":
bool.TryParse(value, out saveLocalesFolders);
_ = bool.TryParse(value, out saveLocalesFolders);
break;
}
}
Expand All @@ -94,7 +90,7 @@ private static void Main(string[] args)
.Where(fi => !fi.FullName.Contains(folderToIgnore))
.Select(fi => fi.Name.Replace(fi.Extension, "")).ToList();

if (string.IsNullOrEmpty(pluginPaths) || !fileNames.Any())
if (string.IsNullOrEmpty(pluginPaths) || fileNames.Count == 0)
{
return;
}
Expand Down

0 comments on commit 15f248d

Please sign in to comment.