aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Common/ReleaseInformations.cs
blob: 1dcb4bf3039b8a99ed5656cc7d6d0960e18cb721 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
namespace Ryujinx.Common
{
    // DO NOT EDIT, filled by CI
    public static class ReleaseInformations
    {
        public static string BuildVersion = "%%RYUJINX_BUILD_VERSION%%";
        public static string BuildGitHash = "%%RYUJINX_BUILD_GIT_HASH%%";
        public static string ReleaseChannelName = "%%RYUJINX_TARGET_RELEASE_CHANNEL_NAME%%";
        public static string ReleaseChannelOwner = "%%RYUJINX_TARGET_RELEASE_CHANNEL_OWNER%%";
        public static string ReleaseChannelRepo = "%%RYUJINX_TARGET_RELEASE_CHANNEL_REPO%%";

        public static bool IsValid()
        {
            return !BuildGitHash.StartsWith("%%") &&
                   !ReleaseChannelName.StartsWith("%%") &&
                   !ReleaseChannelOwner.StartsWith("%%") &&
                   !ReleaseChannelRepo.StartsWith("%%");
        }

        public static string GetVersion()
        {
            if (IsValid())
            {
                return BuildVersion;
            }
            else
            {
                return "1.0.0-dirty";
            }
        }
    }
}