Don't add os-arch to pluginname if it's already correct

This commit is contained in:
idk
2022-02-03 01:51:33 -05:00
parent b2fe36b0d3
commit 73d90ed5c4

View File

@@ -104,24 +104,25 @@ public class ShellService implements ClientApp {
String tmp_name = this.getName();
File pluginDir = new File(_context.getConfigDir(), PLUGIN_DIR + '/' + tmp_name);
if (!pluginDir.exists())
if (!pluginDir.exists()){
pluginDir = new File(_context.getConfigDir(), PLUGIN_DIR + '/' + tmp_name+"-"+SystemVersion.getOS()+"-"+SystemVersion.getArch());
if (!pluginDir.exists()) {
pluginDir = new File(_context.getConfigDir(), PLUGIN_DIR + '/' + tmp_name+"-"+SystemVersion.getOS());
if (!pluginDir.exists())
throw new RuntimeException("Plugin directory does not exist: " + pluginDir.getAbsolutePath());
else{
this.name = tmp_name+"-"+SystemVersion.getOS();
if (!pluginDir.exists()) {
pluginDir = new File(_context.getConfigDir(), PLUGIN_DIR + '/' + tmp_name+"-"+SystemVersion.getOS());
if (!pluginDir.exists()) {
throw new RuntimeException("Plugin directory does not exist: " + pluginDir.getAbsolutePath());
} else {
this.name = tmp_name+"-"+SystemVersion.getOS();
if (_log.shouldDebug())
_log.debug("ShellService: Plugin name revised to match directory: " + this.getName());
}
} else {
this.name = tmp_name+"-"+SystemVersion.getOS()+"-"+SystemVersion.getArch();
if (_log.shouldDebug())
_log.debug("ShellService: Plugin name revised to match directory: " + this.getName());
}
} else {
this.name = tmp_name+"-"+SystemVersion.getOS()+"-"+SystemVersion.getArch();
if (_log.shouldDebug())
_log.debug("ShellService: Plugin name revised to match directory: " + this.getName());
}
_errorLog = new File(pluginDir, "error.log");
_outputLog = new File(pluginDir, "output.log");
_pb.redirectOutput(_outputLog);