Prepare for single file deployment
This commit is contained in:
parent
359ccd5678
commit
2ef837841f
@ -87,13 +87,19 @@ internal class Program
|
||||
|
||||
private static void LogConfigValues()
|
||||
{
|
||||
var log = $"Config values: {nameof(Configs.SE_COUNT)} : {Configs.SE_COUNT}\n" +
|
||||
var configs = $"Config values: {nameof(Configs.SE_COUNT)} : {Configs.SE_COUNT}\n" +
|
||||
$"{nameof(Configs.ITEM_COUNT)} : {Configs.ITEM_COUNT}\n" +
|
||||
$"{nameof(Configs.SKIN_COUNT)} : {Configs.SKIN_COUNT}\n" +
|
||||
$"{nameof(Configs.TITLE_COUNT)} : {Configs.TITLE_COUNT}\n" +
|
||||
$"{nameof(Configs.AVATAR_COUNT)} : {Configs.AVATAR_COUNT}\n" +
|
||||
$"{nameof(Configs.NAVIGATOR_COUNT)} : {Configs.NAVIGATOR_COUNT}\n" +
|
||||
$"{nameof(Configs.MUSIC_DB_NAME)} : {Configs.MUSIC_DB_NAME}\n";
|
||||
log.Info();
|
||||
configs.Info();
|
||||
|
||||
var paths = $"Paths: {nameof(PathHelper.HtmlRootPath)}: {PathHelper.HtmlRootPath}\n" +
|
||||
$"{nameof(PathHelper.LogRootPath)}: {PathHelper.LogRootPath}\n" +
|
||||
$"{nameof(PathHelper.DataBaseRootPath)}: {PathHelper.DataBaseRootPath}\n";
|
||||
paths.Info();
|
||||
|
||||
}
|
||||
}
|
@ -1,5 +1,4 @@
|
||||
using System.Diagnostics;
|
||||
using Swan;
|
||||
|
||||
namespace GCLocalServerRewrite.common;
|
||||
|
||||
@ -21,24 +20,18 @@ public static class PathHelper
|
||||
{
|
||||
get
|
||||
{
|
||||
var assemblyPath = Path.GetDirectoryName(typeof(Program).Assembly.Location);
|
||||
var assemblyPath = AppContext.BaseDirectory;
|
||||
|
||||
#if DEBUG
|
||||
|
||||
|
||||
Debug.Assert(assemblyPath != null, $"{nameof(assemblyPath)} != null");
|
||||
|
||||
var parentFullName = Directory.GetParent(assemblyPath)?.Parent?.Parent?.FullName;
|
||||
var parentFullName = Directory.GetParent(assemblyPath)?.Parent?.Parent?.Parent?.FullName;
|
||||
|
||||
Debug.Assert(parentFullName != null, $"{nameof(parentFullName)} != null");
|
||||
|
||||
return parentFullName;
|
||||
#else
|
||||
if (assemblyPath != null)
|
||||
{
|
||||
return assemblyPath;
|
||||
}
|
||||
|
||||
throw SelfCheck.Failure("Cannot get assembly path!");
|
||||
return AppContext.BaseDirectory;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user