Skip to content

Commit

Permalink
Merge pull request #684 from mcneel/AndyPayne/Compute-298
Browse files Browse the repository at this point in the history
testing changes for Compute-298
  • Loading branch information
andyopayne authored Oct 28, 2024
2 parents b826c51 + 777001f commit 19889e3
Showing 1 changed file with 11 additions and 17 deletions.
28 changes: 11 additions & 17 deletions src/hops/HopsComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -365,24 +365,18 @@ public override bool Read(GH_IReader reader)
var pathType = RemoteDefinition.GetPathType(path);
if (pathType == RemoteDefinition.PathType.GrasshopperDefinition)
{
if (!File.Exists(path))
if (!File.Exists(path) && !path.StartsWith("http", StringComparison.OrdinalIgnoreCase))
{
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;
}
// 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 19889e3

Please sign in to comment.