From 12404ba6f67b594a4364d0dbabd5f0b1d17dd7f7 Mon Sep 17 00:00:00 2001 From: Kamron Batman <3953314+kamronbatman@users.noreply.github.com> Date: Sun, 12 Jun 2022 09:59:23 -0700 Subject: [PATCH] fix: Fixes linux not enumerating directories, and wrong spelling for migration files (#1049) --- Projects/Server/Main.cs | 11 +++++++---- ...on => Server.Items.SpinningWheelEastAddon.v0.json} | 0 ...son => Server.Items.SpinningWheelEastDeed.v0.json} | 0 ...n => Server.Items.SpinningWheelSouthAddon.v0.json} | 0 ...on => Server.Items.SpinningWheelSouthDeed.v0.json} | 0 5 files changed, 7 insertions(+), 4 deletions(-) rename Projects/UOContent/Migrations/{Server.Items.SpinningwheelEastAddon.v0.json => Server.Items.SpinningWheelEastAddon.v0.json} (100%) rename Projects/UOContent/Migrations/{Server.Items.SpinningwheelEastDeed.v0.json => Server.Items.SpinningWheelEastDeed.v0.json} (100%) rename Projects/UOContent/Migrations/{Server.Items.SpinningwheelSouthAddon.v0.json => Server.Items.SpinningWheelSouthAddon.v0.json} (100%) rename Projects/UOContent/Migrations/{Server.Items.SpinningwheelSouthDeed.v0.json => Server.Items.SpinningWheelSouthDeed.v0.json} (100%) diff --git a/Projects/Server/Main.cs b/Projects/Server/Main.cs index c684e5fcf..f964a49b0 100644 --- a/Projects/Server/Main.cs +++ b/Projects/Server/Main.cs @@ -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)) diff --git a/Projects/UOContent/Migrations/Server.Items.SpinningwheelEastAddon.v0.json b/Projects/UOContent/Migrations/Server.Items.SpinningWheelEastAddon.v0.json similarity index 100% rename from Projects/UOContent/Migrations/Server.Items.SpinningwheelEastAddon.v0.json rename to Projects/UOContent/Migrations/Server.Items.SpinningWheelEastAddon.v0.json diff --git a/Projects/UOContent/Migrations/Server.Items.SpinningwheelEastDeed.v0.json b/Projects/UOContent/Migrations/Server.Items.SpinningWheelEastDeed.v0.json similarity index 100% rename from Projects/UOContent/Migrations/Server.Items.SpinningwheelEastDeed.v0.json rename to Projects/UOContent/Migrations/Server.Items.SpinningWheelEastDeed.v0.json diff --git a/Projects/UOContent/Migrations/Server.Items.SpinningwheelSouthAddon.v0.json b/Projects/UOContent/Migrations/Server.Items.SpinningWheelSouthAddon.v0.json similarity index 100% rename from Projects/UOContent/Migrations/Server.Items.SpinningwheelSouthAddon.v0.json rename to Projects/UOContent/Migrations/Server.Items.SpinningWheelSouthAddon.v0.json diff --git a/Projects/UOContent/Migrations/Server.Items.SpinningwheelSouthDeed.v0.json b/Projects/UOContent/Migrations/Server.Items.SpinningWheelSouthDeed.v0.json similarity index 100% rename from Projects/UOContent/Migrations/Server.Items.SpinningwheelSouthDeed.v0.json rename to Projects/UOContent/Migrations/Server.Items.SpinningWheelSouthDeed.v0.json