Fixed bug in linux version for downloading the first plugin only whatever the plugin name was

This commit is contained in:
2023-12-17 16:44:52 +02:00
parent 2280957ea9
commit fe32ebc4d7
2 changed files with 10 additions and 7 deletions

View File

@@ -38,7 +38,8 @@ public class Plugin: ICommandAction
#if !DEBUG #if !DEBUG
new PluginsManager(); new PluginsManager();
#else #else
new PluginsManager("tests"); // new PluginsManager("tests");
new PluginsManager();
#endif #endif
switch (args[0]) switch (args[0])

View File

@@ -148,12 +148,14 @@ public class PluginsManager
} }
else if (Functions.GetOperatingSystem() == OperatingSystem.LINUX && contents[4].Contains("Linux")) else if (Functions.GetOperatingSystem() == OperatingSystem.LINUX && contents[4].Contains("Linux"))
{ {
if (contents.Length == 6) if (contents[0].ToLowerInvariant() == name.ToLowerInvariant())
return new[] { contents[2], contents[3], contents[5] }; {
if (contents.Length == 5) if (contents.Length == 6)
return new[] { contents[2], contents[3], string.Empty }; return new[] { contents[2], contents[3], contents[5] };
throw new Exception("Failed to download plugin. Invalid Argument Length"); if (contents.Length == 5)
return new[] { contents[2], contents[3], string.Empty };
throw new Exception("Failed to download plugin. Invalid Argument Length");
}
} }
} }
} }