-
Notifications
You must be signed in to change notification settings - Fork 26
/
SettingsManager.cs
28 lines (25 loc) · 1.08 KB
/
SettingsManager.cs
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
using Microsoft.Extensions.Configuration;
namespace BuildBackup
{
public static class SettingsManager
{
public static string cacheDir;
public static string[] checkProducts;
public static string[] backupProducts;
public static bool useRibbit;
public static bool downloadPatchFiles;
static SettingsManager()
{
LoadSettings();
}
public static void LoadSettings()
{
var config = new ConfigurationBuilder().AddJsonFile("config.json", optional: false, reloadOnChange: false).Build();
cacheDir = config.GetSection("config").GetSection("cacheDir").Get<string>();
checkProducts = config.GetSection("config").GetSection("checkProducts").Get<string[]>();
backupProducts = config.GetSection("config").GetSection("backupProducts").Get<string[]>();
useRibbit = config.GetSection("config").GetSection("useRibbit").Get<bool>();
downloadPatchFiles = config.GetSection("config").GetSection("downloadPatchFiles").Get<bool>();
}
}
}