/// <summary>
        ///     Default constructor.
        /// </summary>
        public SettingsEntity()
        {
            GitBranch = new ResultLookup <string>(DevConstants.DevError);
            GitHash   = new ResultLookup <string>(DevConstants.DevError);

            LastProjectEntity = new ProjectSerializerEntity();
        }
Пример #2
0
        private static IResultLookup <string> GetGitHash()
        {
            var buildInfoPath = @"./build-info";
            var fileExists    = File.Exists(buildInfoPath);

            IResultLookup <string> result = new ResultLookup <string>(false, "Unknown", "File does not exist");

            if (fileExists)
            {
                var pathLines = File.ReadAllLines(buildInfoPath);

                if (pathLines.Length >= 2)
                {
                    result = new ResultLookup <string>(true, pathLines[1]);
                }
            }

            return(result);
        }