Skip to content

Commit ac0f58e

Browse files
committed
test2
1 parent 6a1962b commit ac0f58e

File tree

1 file changed

+4
-13
lines changed

1 file changed

+4
-13
lines changed

src/Packer/Program.cs

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,12 @@ class Program
1616
// System.CommandLine.DragonFruit支持
1717
public static async Task Main(string version, bool increment = false)
1818
{
19-
var levelSwitch = new Serilog.Core.LoggingLevelSwitch();
20-
2119
Log.Logger = new LoggerConfiguration()
2220
.Enrich.FromLogContext()
2321
.WriteTo.Console()
24-
.MinimumLevel.ControlledBy(levelSwitch) // 以便 debug 时修改这一等级
22+
.MinimumLevel.Debug()
2523
.CreateLogger();
2624

27-
// 若开启了debug logging,显示更多日志(包括IEnumerable里的东西)
28-
if (Environment.GetEnvironmentVariable("ACTIONS_STEP_DEBUG") == "true")
29-
levelSwitch.MinimumLevel = Serilog.Events.LogEventLevel.Debug;
30-
3125
var config = await ConfigHelpers.RetrieveConfig(configTemplate: "./config/packer/{0}.json",
3226
version: version);
3327
Log.Information("开始对版本 {0} 的打包", config.Base.Version);
@@ -72,20 +66,17 @@ select config.Floating.DestinationReplacement // 全局路
7266
? McMetaProvider.Create(file, file.Name) // 类型推断不出要用接口
7367
: new RawFile(file, file.Name) as IResourceFileProvider;
7468

75-
var totalQuery = query.Concat(initialsQuery);
76-
7769
string packName = $"./Minecraft-Mod-Language-Package-{config.Base.Version}.zip";
7870
await using var stream = File.Create(packName);
7971

8072
using (var archive = new ZipArchive(stream, ZipArchiveMode.Update, leaveOpen: true))
8173
{
82-
await Task.WhenAll(from provider in totalQuery
74+
await Task.WhenAll(from provider in query.Concat(initialsQuery)
8375
select provider.WriteToArchive(archive));
84-
}
8576

77+
78+
}
8679
Log.Information("对版本 {0} 的打包结束。", version);
87-
if (totalQuery.TryGetNonEnumeratedCount(out var count))
88-
Log.Information("文件总数:{0}", count);
8980

9081
var md5 = stream.ComputeMD5();
9182

0 commit comments

Comments
 (0)