Skip to content

Commit

Permalink
PluginBase packer workaround
Browse files Browse the repository at this point in the history
  • Loading branch information
S74nk0 committed Jan 7, 2020
1 parent 9d046b1 commit 257e05a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/Miners/MinerPluginToolkitV1/PluginBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ namespace MinerPluginToolkitV1
// TODO add documentation
public abstract class PluginBase : IMinerPlugin, IInitInternals, IBinaryPackageMissingFilesChecker, IReBenchmarkChecker, IGetApiMaxTimeoutV2, IMinerBinsSource, IBinAndCwdPathsGettter, IGetMinerBinaryVersion, IGetPluginMetaInfo, IPluginSupportedAlgorithmsSettings
{
public static bool IS_CALLED_FROM_PACKER { get; set; } = false;
protected abstract MinerBase CreateMinerBase();

#region IMinerPlugin
Expand Down Expand Up @@ -104,6 +105,7 @@ public virtual void InitInternals()
protected void InitInsideConstuctorPluginSupportedAlgorithmsSettings()
{
PluginSupportedAlgorithmsSettings = DefaultPluginSupportedAlgorithmsSettings;
if (IS_CALLED_FROM_PACKER) return;
var pluginRoot = Path.Combine(Paths.MinerPluginsPath(), PluginUUID);
var filePluginSupportedAlgorithmsSettings = InternalConfigs.InitInternalSetting(pluginRoot, PluginSupportedAlgorithmsSettings, "PluginSupportedAlgorithmsSettings.json");
if (filePluginSupportedAlgorithmsSettings != null) PluginSupportedAlgorithmsSettings = filePluginSupportedAlgorithmsSettings;
Expand Down
1 change: 1 addition & 0 deletions src/Tools/MinerPluginsPacker/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ private static void AddPluginToPluginPackageInfos(IMinerPlugin plugin)
// TODO add more options
static void Main(string[] args)
{
PluginBase.IS_CALLED_FROM_PACKER = true;
if (args.Length < 1)
{
Console.WriteLine("Set miner plugins root path");
Expand Down

0 comments on commit 257e05a

Please sign in to comment.