feat: upgrade to .NET 6, refactor everything

This commit is contained in:
spiral
2021-11-26 21:10:56 -05:00
parent d28e99ba43
commit 1918c56937
314 changed files with 27954 additions and 27966 deletions

View File

@@ -1,27 +1,25 @@
using System.IO;
using System.Threading.Tasks;
namespace PluralKit.Core;
namespace PluralKit.Core
public static class BuildInfoService
{
public static class BuildInfoService
public static string Version { get; private set; }
public static string FullVersion { get; private set; }
public static async Task LoadVersion()
{
public static string Version { get; private set; }
public static string FullVersion { get; private set; }
public static async Task LoadVersion()
using (var stream = typeof(BuildInfoService).Assembly.GetManifestResourceStream("version"))
{
using (var stream = typeof(BuildInfoService).Assembly.GetManifestResourceStream("version"))
{
// if this happens, something broke
if (stream == null) FullVersion = "(unknown version) ";
else using (var reader = new StreamReader(stream)) FullVersion = await reader.ReadToEndAsync();
}
// cheap hack to remove newline
FullVersion = FullVersion.Remove(FullVersion.Length - 1);
// show only short commit hash to users
Version = FullVersion.Remove(7);
// if this happens, something broke
if (stream == null) FullVersion = "(unknown version) ";
else
using (var reader = new StreamReader(stream))
FullVersion = await reader.ReadToEndAsync();
}
// cheap hack to remove newline
FullVersion = FullVersion.Remove(FullVersion.Length - 1);
// show only short commit hash to users
Version = FullVersion.Remove(7);
}
}