fix: Fixes linux not enumerating directories, and wrong spelling for migration files (#1049)

This commit is contained in:
Kamron Batman 2022-06-12 09:59:23 -07:00 committed by GitHub
parent ff1b7aa994
commit 12404ba6f6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 7 additions and 4 deletions

View file

@ -252,10 +252,13 @@ namespace Server
if (IsLinux && !File.Exists(fullPath))
{
var fi = new FileInfo(fullPath);
fullPath = fi.Directory!.EnumerateFiles(
fi.Name,
new EnumerationOptions { MatchCasing = MatchCasing.CaseInsensitive }
).FirstOrDefault()?.FullName;
if (fi.Directory != null && Directory.Exists(fi.Directory.FullName))
{
fullPath = fi.Directory.EnumerateFiles(
fi.Name,
new EnumerationOptions { MatchCasing = MatchCasing.CaseInsensitive }
).FirstOrDefault()?.FullName;
}
}
if (File.Exists(fullPath))