Add config file loading
This commit is contained in:
parent
42147fd9cc
commit
b5c9793578
@ -1,6 +1,7 @@
|
||||
using System;
|
||||
using System.Data;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Threading;
|
||||
@ -21,6 +22,8 @@ namespace PluralKit.Bot
|
||||
private IConfiguration _config;
|
||||
|
||||
static void Main(string[] args) => new Initialize { _config = new ConfigurationBuilder()
|
||||
.SetBasePath(Directory.GetCurrentDirectory())
|
||||
.AddJsonFile("pluralkit.conf", true)
|
||||
.AddEnvironmentVariables()
|
||||
.AddCommandLine(args)
|
||||
.Build()}.MainAsync().GetAwaiter().GetResult();
|
||||
|
@ -11,6 +11,7 @@
|
||||
<PackageReference Include="Microsoft.Extensions.Configuration.Binder" Version="2.2.4" />
|
||||
<PackageReference Include="Microsoft.Extensions.Configuration.CommandLine" Version="2.2.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="2.2.4" />
|
||||
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="2.2.0" />
|
||||
<PackageReference Include="Newtonsoft.Json" Version="12.0.2" />
|
||||
<PackageReference Include="Npgsql" Version="4.0.6" />
|
||||
<PackageReference Include="Npgsql.NodaTime" Version="4.0.6" />
|
||||
|
Loading…
Reference in New Issue
Block a user