mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-08-19 21:03:17 -07:00
Use the AppContext API as it's reccommended (just best practises)
This commit is contained in:
parent
0c6cd92f59
commit
36af39ebca
1 changed files with 2 additions and 2 deletions
|
@ -251,12 +251,12 @@ namespace Ombi
|
|||
if (setBaseUrl)
|
||||
{
|
||||
var trimmedBaseUrl = baseUrl.EndsWith('/') ? baseUrl.TrimEnd('/') : baseUrl;
|
||||
var process = Process.GetCurrentProcess().MainModule.FileName;
|
||||
var process = AppContext.BaseDirectory;
|
||||
var ombiInstalledDir = Path.GetDirectoryName(process);
|
||||
var indexPath = Path.Combine(ombiInstalledDir, "ClientApp", "dist", "index.html");
|
||||
if (!File.Exists(indexPath))
|
||||
{
|
||||
var error = $"Can't set the base URL because we cannot find the file at {indexPath}, if you are trying to set a base url please report this on Github!";
|
||||
var error = $"Can't set the base URL because we cannot find the file at '{indexPath}', if you are trying to set a base url please report this on Github!";
|
||||
Console.WriteLine(error);
|
||||
throw new Exception(error);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue