From e96dafe434a95f815914806a1cc35a868f733cbe Mon Sep 17 00:00:00 2001 From: Tudor Stanciu Date: Sat, 14 Jan 2023 12:51:49 +0200 Subject: [PATCH] Netmash.Infrastructure.DatabaseMigration: GetScriptPacks fix --- .../Services/MigrationService.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/infrastructure/Netmash.Infrastructure.DatabaseMigration/Services/MigrationService.cs b/src/infrastructure/Netmash.Infrastructure.DatabaseMigration/Services/MigrationService.cs index 141af05..d046529 100644 --- a/src/infrastructure/Netmash.Infrastructure.DatabaseMigration/Services/MigrationService.cs +++ b/src/infrastructure/Netmash.Infrastructure.DatabaseMigration/Services/MigrationService.cs @@ -75,7 +75,11 @@ namespace Netmash.Infrastructure.DatabaseMigration.Services private ScriptPack[] GetScriptPacks() { - var scripts = Directory.GetDirectories(_configuration.ScriptsDirectory); + var scriptsPath = Directory.Exists(_configuration.ScriptsDirectory) ? + _configuration.ScriptsDirectory : + Path.Combine(Path.GetDirectoryName(Environment.ProcessPath), _configuration.ScriptsDirectory); + + var scripts = Directory.GetDirectories(scriptsPath); var packs = scripts.Select(z => new ScriptPack() { Path = z, Version = new Version(new DirectoryInfo(z).Name) }); return packs.ToArray();