build: 📦 整理构建相关的工程文件 (#64)

This commit is contained in:
2023-11-22 16:02:07 +08:00
committed by GitHub
parent b4b4f23968
commit 20195e7eaf
38 changed files with 95 additions and 134 deletions

44
scripts/code.clean.csx Normal file
View File

@ -0,0 +1,44 @@
using System.Text.RegularExpressions;
using System.Net.Http;
using System.Net.Http.Json;
{
var files = string.Join(
';',
Args[0]
.Split('\n', StringSplitOptions.RemoveEmptyEntries)
.Select(x => x.Replace('\\', '/').Trim())
);
Console.WriteLine(files);
using var p = Process.Start(
new ProcessStartInfo
{
CreateNoWindow = true,
FileName = "dotnet",
Arguments = $"jb cleanupcode --include=\"{files}\" --no-build ../NetAdmin.sln",
UseShellExecute = false,
RedirectStandardOutput = true
}
);
p.WaitForExit();
Console.WriteLine(p.StandardOutput.ReadToEnd());
using var p2 = Process.Start(
new ProcessStartInfo
{
CreateNoWindow = true,
FileName = "git",
Arguments = $"status",
UseShellExecute = false,
RedirectStandardOutput = true
}
);
p2.WaitForExit();
var content = p2.StandardOutput.ReadToEnd();
Console.WriteLine(content);
return content.Contains("working tree clean") ? 0 : 1;
}