Skip to content

Commit

Permalink
fix: When looking for the installers, ignore everything that isn't a …
Browse files Browse the repository at this point in the history
…JAR-file.
  • Loading branch information
itssimple committed May 14, 2022
1 parent 0c006ba commit 980a014
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion CurseForge.Minecraft.Serverpack.Launcher/FabricMethods.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ partial class Program
{
private static async Task InstallFabricAsync(string installPath, string minecraftVersion, string loaderVersion, string javaArgs, bool startServer)
{
var fabricInstaller = Directory.EnumerateFiles(installPath).FirstOrDefault(f => f.Contains("fabric-installer-"));
var fabricInstaller = Directory.EnumerateFiles(installPath).FirstOrDefault(f => f.Contains("fabric-installer-") && f.EndsWith(".jar"));
if (fabricInstaller == null)
{
throw new Exception("Couldn't find the installer, bailing out");
Expand Down
4 changes: 2 additions & 2 deletions CurseForge.Minecraft.Serverpack.Launcher/ForgeMethods.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ partial class Program
{
private static async Task InstallForgeAsync(string installPath, string javaArgs, bool startServer)
{
var forgeInstaller = Directory.EnumerateFiles(installPath).FirstOrDefault(f => f.Contains("forge-") && f.Contains("-installer.jar"));
var forgeInstaller = Directory.EnumerateFiles(installPath).FirstOrDefault(f => f.Contains("forge-") && f.Contains("-installer.jar") && f.EndsWith(".jar"));
if (forgeInstaller == null)
{
throw new Exception("Couldn't find the installer, bailing out");
Expand All @@ -22,7 +22,7 @@ private static async Task InstallForgeAsync(string installPath, string javaArgs,

await RunProcessAsync(installPath, GetJavaExecutable(), false, arguments);

var forgeLoader = Directory.EnumerateFiles(installPath, "*.jar", SearchOption.AllDirectories).FirstOrDefault(f => f.Contains("forge-") && !f.Contains("-installer.jar"));
var forgeLoader = Directory.EnumerateFiles(installPath, "*.jar", SearchOption.AllDirectories).FirstOrDefault(f => f.Contains("forge-") && !f.Contains("-installer.jar") && f.EndsWith(".jar"));

if (forgeLoader == null)
{
Expand Down

0 comments on commit 980a014

Please sign in to comment.