mirror of
https://github.com/dnwSilver/tld.git
synced 2025-01-19 09:22:08 +00:00
🚧 Add unstable version indicator.
This commit is contained in:
parent
28b4480f30
commit
1bc1af71c9
@ -13,9 +13,10 @@ public static class VersionExtensions
|
|||||||
VersionType.Candidate => "",
|
VersionType.Candidate => "",
|
||||||
VersionType.Canary => "",
|
VersionType.Canary => "",
|
||||||
VersionType.Next => "",
|
VersionType.Next => "",
|
||||||
|
VersionType.Unstable => "",
|
||||||
_ => ""
|
_ => ""
|
||||||
};
|
};
|
||||||
|
|
||||||
public static string Colorize(this VersionStatus versionStatus, string value) =>
|
public static string Colorize(this VersionStatus versionStatus, string value) =>
|
||||||
versionStatus switch
|
versionStatus switch
|
||||||
{
|
{
|
||||||
|
@ -3,6 +3,7 @@ namespace TUI.Controls.Components;
|
|||||||
public enum VersionType
|
public enum VersionType
|
||||||
{
|
{
|
||||||
Convention,
|
Convention,
|
||||||
|
Unstable,
|
||||||
Release,
|
Release,
|
||||||
Candidate,
|
Candidate,
|
||||||
Canary,
|
Canary,
|
||||||
|
@ -21,6 +21,11 @@ public class Version
|
|||||||
|
|
||||||
Major = Convert.ToInt32(parts[0].RemoveVersionPrefix());
|
Major = Convert.ToInt32(parts[0].RemoveVersionPrefix());
|
||||||
|
|
||||||
|
if (version.StartsWith("^"))
|
||||||
|
{
|
||||||
|
Type = VersionType.Unstable;
|
||||||
|
}
|
||||||
|
|
||||||
if (parts.Length == 1)
|
if (parts.Length == 1)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
@ -44,7 +49,7 @@ public class Version
|
|||||||
not null when extension.Contains("alpha") => VersionType.Alpha,
|
not null when extension.Contains("alpha") => VersionType.Alpha,
|
||||||
not null when extension.Contains("canary") => VersionType.Canary,
|
not null when extension.Contains("canary") => VersionType.Canary,
|
||||||
not null when extension.Contains("next") => VersionType.Next,
|
not null when extension.Contains("next") => VersionType.Next,
|
||||||
_ => VersionType.Release
|
_ => version.StartsWith("^") ? VersionType.Unstable : VersionType.Release
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user