From 9588123f53797844cba191d58d092b99dc0146fc Mon Sep 17 00:00:00 2001 From: LotP1 Date: Wed, 18 Dec 2024 21:57:02 +0100 Subject: [PATCH] fix not building locally with dotnet build --- .../LocaleValidationTask.cs | 14 ++++++++++---- .../Ryujinx.BuildValidationTasks.csproj | 2 +- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/Ryujinx.BuildValidationTasks/LocaleValidationTask.cs b/src/Ryujinx.BuildValidationTasks/LocaleValidationTask.cs index 82a6228ac..183228fdd 100644 --- a/src/Ryujinx.BuildValidationTasks/LocaleValidationTask.cs +++ b/src/Ryujinx.BuildValidationTasks/LocaleValidationTask.cs @@ -14,10 +14,16 @@ namespace Ryujinx.BuildValidationTasks { string path = System.Reflection.Assembly.GetExecutingAssembly().Location; - path = path.Split(new string[] { "src" }, StringSplitOptions.None)[0]; - - - path = new FileInfo(path).Directory.GetDirectories("src")[0].GetDirectories("Ryujinx")[0].GetDirectories("Assets")[0].GetFiles("locales.json")[0].FullName; + if (path.Split(new string[] { "src" }, StringSplitOptions.None).Length == 1 ) + { + //i assume that we are in a build directory in the solution dir + path = new FileInfo(path).Directory.Parent.GetDirectories("src")[0].GetDirectories("Ryujinx")[0].GetDirectories("Assets")[0].GetFiles("locales.json")[0].FullName; + } + else + { + path = path.Split(new string[] { "src" }, StringSplitOptions.None)[0]; + path = new FileInfo(path).Directory.GetDirectories("src")[0].GetDirectories("Ryujinx")[0].GetDirectories("Assets")[0].GetFiles("locales.json")[0].FullName; + } string data; diff --git a/src/Ryujinx.BuildValidationTasks/Ryujinx.BuildValidationTasks.csproj b/src/Ryujinx.BuildValidationTasks/Ryujinx.BuildValidationTasks.csproj index 218c95d77..f66927488 100644 --- a/src/Ryujinx.BuildValidationTasks/Ryujinx.BuildValidationTasks.csproj +++ b/src/Ryujinx.BuildValidationTasks/Ryujinx.BuildValidationTasks.csproj @@ -11,7 +11,7 @@ - +