fix: add flag for testing plugins, don't load testing plugins if testing is disabled

This commit is contained in:
goat 2020-10-02 20:57:56 +02:00
parent 770363e2d2
commit e498da8079
2 changed files with 15 additions and 1 deletions

View file

@ -93,12 +93,18 @@ namespace Dalamud.Plugin
// If this entire folder has been marked as a disabled plugin, don't even try to load anything
var disabledFile = new FileInfo(Path.Combine(dllFile.Directory.FullName, ".disabled"));
if (disabledFile.Exists && !raw) // should raw/dev plugins really not respect this?
if (disabledFile.Exists && !raw) // should raw/dev plugins really not respect this?
{
Log.Information("Plugin {0} is disabled.", dllFile.FullName);
return false;
}
var testingFile = new FileInfo(Path.Combine(dllFile.Directory.FullName, ".testing"));
if (testingFile.Exists && this.dalamud.Configuration.DoPluginTest) {
Log.Information("Plugin {0} was testing, but testing is disabled.", dllFile.FullName);
return false;
}
// read the plugin def if present - again, fail before actually trying to load the dll if there is a problem
var defJsonFile = new FileInfo(Path.Combine(dllFile.Directory.FullName, $"{Path.GetFileNameWithoutExtension(dllFile.Name)}.json"));