Skip to content

Commit 23dc6ff

Browse files
committed
Fix check for Robots plugin when loaded after Extensions
1 parent 4237273 commit 23dc6ff

3 files changed

Lines changed: 12 additions & 17 deletions

File tree

Directory.Build.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<Product>Extensions</Product>
5-
<Version>1.0.0</Version>
5+
<Version>1.0.1</Version>
66
<Description>Assorted components for Grasshopper.</Description>
77
<Authors>Extensions Authors</Authors>
88
<Copyright>Copyright (c) 2021 $(Authors)</Copyright>

RELEASE

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
- version: 1.0.1
2+
changes:
3+
- Fix check for Robots plugin when loaded after Extensions.
14
- version: 1.0.0
25
changes:
36
- Updated to work with the latest Robots plugin.

src/Extensions.Grasshopper/ExtensionsInfo.cs

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -11,24 +11,16 @@ public class ExtensionsInfo : GH_AssemblyInfo
1111

1212
public ExtensionsInfo()
1313
{
14-
var componentServer = Instances.ComponentServer;
15-
16-
if (componentServer.Libraries.Any(l => l.Name == "Robots"))
14+
foreach (var folder in Folders.AssemblyFolders)
1715
{
18-
IsRobotsInstalled = true;
19-
return;
20-
}
21-
22-
componentServer.GHAFileLoaded += CheckLoadrobots;
23-
}
16+
var files = Directory.EnumerateFiles(folder.Folder, "Robots.gha", SearchOption.TopDirectoryOnly);
2417

25-
void CheckLoadrobots(object sender, GH_GHALoadingEventArgs e)
26-
{
27-
if (e.Name != "Robots")
28-
return;
29-
30-
IsRobotsInstalled = true;
31-
Instances.ComponentServer.GHAFileLoaded -= CheckLoadrobots;
18+
if (files.Any())
19+
{
20+
IsRobotsInstalled = true;
21+
break;
22+
}
23+
}
3224
}
3325

3426
public override string Name => GetInfo<AssemblyProductAttribute>().Product;

0 commit comments

Comments
 (0)