mirror of
https://github.com/zoriya/Kyoo.git
synced 2025-07-09 03:04:20 -04:00
Setting default environement to debug if configuration is
This commit is contained in:
parent
44323f42e7
commit
b86a977262
@ -17,7 +17,7 @@ namespace Kyoo
|
|||||||
File.Copy(Path.Join(AppDomain.CurrentDomain.BaseDirectory, "appsettings.json"), "appsettings.json");
|
File.Copy(Path.Join(AppDomain.CurrentDomain.BaseDirectory, "appsettings.json"), "appsettings.json");
|
||||||
|
|
||||||
|
|
||||||
bool? debug = Environment.GetEnvironmentVariable("ENVIRONEMENT")?.ToLowerInvariant() switch
|
bool? debug = Environment.GetEnvironmentVariable("ENVIRONMENT")?.ToLowerInvariant() switch
|
||||||
{
|
{
|
||||||
"d" => true,
|
"d" => true,
|
||||||
"dev" => true,
|
"dev" => true,
|
||||||
@ -29,8 +29,11 @@ namespace Kyoo
|
|||||||
_ => null
|
_ => null
|
||||||
};
|
};
|
||||||
|
|
||||||
if (debug == null)
|
if (debug == null && Environment.GetEnvironmentVariable("ENVIRONMENT") != null)
|
||||||
Console.WriteLine($"Invalid ENVIRONEMENT variable. Supported values are \"debug\" and \"prod\". Ignoring...");
|
Console.WriteLine($"Invalid ENVIRONMENT variable. Supported values are \"debug\" and \"prod\". Ignoring...");
|
||||||
|
#if DEBUG
|
||||||
|
debug ??= true;
|
||||||
|
#endif
|
||||||
|
|
||||||
Console.WriteLine($"Running as {Environment.UserName}.");
|
Console.WriteLine($"Running as {Environment.UserName}.");
|
||||||
IWebHostBuilder host = CreateWebHostBuilder(args);
|
IWebHostBuilder host = CreateWebHostBuilder(args);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user