🚧 Add unstable version indicator.

This commit is contained in:
Kolosov Alexandr 2024-12-10 19:10:17 +05:00
parent 28b4480f30
commit 1bc1af71c9
3 changed files with 9 additions and 2 deletions

View File

@ -13,6 +13,7 @@ public static class VersionExtensions
VersionType.Candidate => "󰑣",
VersionType.Canary => "󱗆",
VersionType.Next => "󰒭",
VersionType.Unstable => "󱓉",
_ => ""
};

View File

@ -3,6 +3,7 @@ namespace TUI.Controls.Components;
public enum VersionType
{
Convention,
Unstable,
Release,
Candidate,
Canary,

View File

@ -21,6 +21,11 @@ public class Version
Major = Convert.ToInt32(parts[0].RemoveVersionPrefix());
if (version.StartsWith("^"))
{
Type = VersionType.Unstable;
}
if (parts.Length == 1)
{
return;
@ -44,7 +49,7 @@ public class Version
not null when extension.Contains("alpha") => VersionType.Alpha,
not null when extension.Contains("canary") => VersionType.Canary,
not null when extension.Contains("next") => VersionType.Next,
_ => VersionType.Release
_ => version.StartsWith("^") ? VersionType.Unstable : VersionType.Release
};
}
}