Skip to content

Commit

Permalink
Merge pull request #680 from mcneel/AndyPayne/Compute-298
Browse files Browse the repository at this point in the history
Andy payne/compute 298
  • Loading branch information
andyopayne authored Oct 11, 2024
2 parents 05bb6d2 + cbdfb40 commit f58f319
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 11 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/workflow_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:
if: ${{ needs.check_src.outputs.any_changed == 'true' || needs.check_workflow.outputs.any_changed == 'true' }}
steps:
- name: checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: revision
Expand All @@ -68,7 +68,7 @@ jobs:
run: dotnet publish src/compute.sln -c Release
- name: artifacts
if: github.ref == 'refs/heads/8.x'
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
path: src/dist
name: rhino.compute
25 changes: 16 additions & 9 deletions src/hops/HopsComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -367,15 +367,22 @@ public override bool Read(GH_IReader reader)
{
if (!File.Exists(path))
{
// See if the file is in the same directoy as this definition. If it
// is then use that file. NOTE: This will change the saved path for
// for this component when we save the GH definition again. That may or
// may not be a problem; I'm not sure yet.
string parentDirectory = Path.GetDirectoryName(reader.ArchiveLocation);
string remoteFileName = Path.GetFileName(path);
string filePath = Path.Combine(parentDirectory, remoteFileName);
if (File.Exists(filePath))
path = filePath;
if(path.StartsWith("http", StringComparison.OrdinalIgnoreCase))
{
RemoteDefinitionLocation = path;
}
else
{
// See if the file is in the same directory as this definition. If it
// is then use that file. NOTE: This will change the saved path for
// for this component when we save the GH definition again. That may or
// may not be a problem; I'm not sure yet.
string parentDirectory = Path.GetDirectoryName(reader.ArchiveLocation);
string remoteFileName = Path.GetFileName(path);
string filePath = Path.Combine(parentDirectory, remoteFileName);
if (File.Exists(filePath))
path = filePath;
}
}
}
RemoteDefinitionLocation = path;
Expand Down

0 comments on commit f58f319

Please sign in to comment.