ファイル
YMM4-GitHubUpdateNotifier/GitHubUpdateNotifier/VersionTag.cs
T

21 行
592 B
C#

using System.Diagnostics.CodeAnalysis;
using YukkuriMovieMaker.Plugin.Update;
namespace GitHubUpdateNotifier;
internal static class VersionTag
{
public static bool TryParse(string? tag, [NotNullWhen(true)] out PluginVersion? version)
{
version = null;
if (string.IsNullOrWhiteSpace(tag))
return false;
var normalized = tag.Trim();
if (normalized.Length > 1 && (normalized[0] is 'v' or 'V') && char.IsDigit(normalized[1]))
normalized = normalized[1..];
return PluginVersion.TryParse(normalized, out version);
}
}