You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
644 B
20 lines
644 B
using System.Text.Json.Serialization; |
|
|
|
namespace StabilityMatrix.Core.Models; |
|
|
|
public class InstalledPackageVersion |
|
{ |
|
public string? InstalledReleaseVersion { get; set; } |
|
public string? InstalledBranch { get; set; } |
|
public string? InstalledCommitSha { get; set; } |
|
|
|
[JsonIgnore] |
|
public bool IsReleaseMode => string.IsNullOrWhiteSpace(InstalledBranch); |
|
|
|
[JsonIgnore] |
|
public string DisplayVersion => (IsReleaseMode |
|
? InstalledReleaseVersion |
|
: string.IsNullOrWhiteSpace(InstalledCommitSha) |
|
? InstalledBranch |
|
: $"{InstalledBranch}@{InstalledCommitSha[..7]}") ?? string.Empty; |
|
}
|
|
|