using OtterGui.Log;
using OtterGui.Services;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CustomizePlus.Core.Services.Dalamud;
public class DalamudBranchService : IService
{
///
/// Current Dalamud branch
///
public DalamudBranch CurrentBranch { get; private set; }
///
/// Current Dalamud branch name
///
public string CurrentBranchName { get; private set; }
public DalamudBranchService(DalamudConfigService dalamudConfigService, Logger logger)
{
dalamudConfigService.GetDalamudConfig(DalamudConfigService.BetaKindOption, out var betaOption);
CurrentBranchName = betaOption?.ToLowerInvariant() ?? "release";
switch (CurrentBranchName)
{
case "release":
CurrentBranch = DalamudBranch.Release;
break;
case "stg":
CurrentBranch = DalamudBranch.Staging;
break;
default:
CurrentBranch = DalamudBranch.Other;
break;
}
logger.Information($"Current Dalamud branch is: {CurrentBranchName} ({CurrentBranch})");
}
public enum DalamudBranch
{
//For our purposes we want to default to Release
Release,
Staging,
Other
}
}