mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-10-16 09:33:48 +00:00
Add UpdateMetadataCommands to update build time
This commit is contained in:
2 files changed
+27
No files matched your search
@@ -0,0 +1,26 @@
|
|||||||
|
namespace Build.Commands;
|
||||||
|
|
||||||
|
// ReSharper disable ClassNeverInstantiated.Global
|
||||||
|
// ReSharper disable UnusedType.Global
|
||||||
|
// ReSharper disable UnusedMember.Global
|
||||||
|
|
||||||
|
public sealed class UpdateMetadataCommands
|
||||||
|
{
|
||||||
|
[Command("test", Description = "Test command")]
|
||||||
|
public async Task Test()
|
||||||
|
{
|
||||||
|
await this.UpdateBuildTime();
|
||||||
|
}
|
||||||
|
|
||||||
|
private async Task UpdateBuildTime()
|
||||||
|
{
|
||||||
|
var pathMetadata = Environment.GetMetadataPath();
|
||||||
|
var lines = await File.ReadAllLinesAsync(pathMetadata, Encoding.UTF8);
|
||||||
|
var buildTime = DateTime.UtcNow.ToString("yyyy-MM-dd HH:mm:ss") + " UTC";
|
||||||
|
|
||||||
|
Console.WriteLine($"- Updating build time from '{lines[1]}' to '{buildTime}'.");
|
||||||
|
|
||||||
|
lines[1] = buildTime;
|
||||||
|
await File.WriteAllLinesAsync(pathMetadata, lines, Encoding.UTF8);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -3,4 +3,5 @@
|
|||||||
var builder = CoconaApp.CreateBuilder();
|
var builder = CoconaApp.CreateBuilder();
|
||||||
var app = builder.Build();
|
var app = builder.Build();
|
||||||
app.AddCommands<CheckRidsCommand>();
|
app.AddCommands<CheckRidsCommand>();
|
||||||
|
app.AddCommands<UpdateMetadataCommands>();
|
||||||
app.Run();
|
app.Run();
|
||||||
Reference in new issue
Block a user