Skip to content

Commit

Permalink
testing changes for Compute-298
Browse files Browse the repository at this point in the history
  • Loading branch information
andyopayne committed Oct 28, 2024
1 parent b826c51 commit 777001f
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 777001f

Please sign in to comment.