remove hard coded paths to make it easier for building in debug mode

auto copy script plugins/localization for local builds
This commit is contained in:
RaidMax
2020-08-26 09:54:56 -05:00
parent 2b3e21d4ba
commit 8a8dec8bbd
5 changed files with 33 additions and 13 deletions

View File

@ -26,7 +26,6 @@ namespace SharedLibraryCore.Database
static string _ConnectionString;
static string _provider;
private static readonly string _migrationPluginDirectory = @"X:\IW4MAdmin\BUILD\Plugins";
private static readonly ILoggerFactory _loggerFactory = LoggerFactory.Create(builder =>
{
builder.AddConsole()
@ -72,7 +71,7 @@ namespace SharedLibraryCore.Database
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
//optionsBuilder.UseLoggerFactory(_loggerFactory)
// .EnableSensitiveDataLogging();
// .EnableSensitiveDataLogging();
if (string.IsNullOrEmpty(_ConnectionString))
{
@ -198,11 +197,14 @@ namespace SharedLibraryCore.Database
// adapted from
// https://aleemkhan.wordpress.com/2013/02/28/dynamically-adding-dbset-properties-in-dbcontext-for-entity-framework-code-first/
#if DEBUG
string pluginDir = _migrationPluginDirectory;
#else
string pluginDir = Path.Join(Utilities.OperatingDirectory, "Plugins");
#endif
if (Utilities.IsDevelopment)
{
pluginDir = Path.Join(Utilities.OperatingDirectory, "..", "..", "..", "..", "BUILD", "Plugins");
}
IEnumerable<string> directoryFiles = Directory.GetFiles(pluginDir).Where(f => f.EndsWith(".dll"));
foreach (string dllPath in directoryFiles)