Netmash.Infrastructure.DatabaseMigration: GetScriptPacks fix

master
Tudor Stanciu 2023-01-14 12:51:49 +02:00
parent 1bc781d794
commit e96dafe434
1 changed files with 5 additions and 1 deletions

View File

@ -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();