diff --git a/Kyoo/Program.cs b/Kyoo/Program.cs index bc6ef89b..474a79b3 100644 --- a/Kyoo/Program.cs +++ b/Kyoo/Program.cs @@ -17,7 +17,7 @@ namespace Kyoo 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, "dev" => true, @@ -29,8 +29,11 @@ namespace Kyoo _ => null }; - if (debug == null) - Console.WriteLine($"Invalid ENVIRONEMENT variable. Supported values are \"debug\" and \"prod\". Ignoring..."); + if (debug == null && Environment.GetEnvironmentVariable("ENVIRONMENT") != null) + Console.WriteLine($"Invalid ENVIRONMENT variable. Supported values are \"debug\" and \"prod\". Ignoring..."); + #if DEBUG + debug ??= true; + #endif Console.WriteLine($"Running as {Environment.UserName}."); IWebHostBuilder host = CreateWebHostBuilder(args);