Skip to content

Commit

Permalink
Fix: use relative path correctly when it is not a remote source (#1773)
Browse files Browse the repository at this point in the history
Signed-off-by: Daishan Peng <[email protected]>
  • Loading branch information
StrongMonkey authored Feb 18, 2025
1 parent f04e079 commit e787154
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions pkg/tools/resolve.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,9 @@ func ResolveToolReferences(ctx context.Context, gptClient *gptscript.GPTScript,
}

peerTool := prg.ToolSet[peerToolID]
ref, _, _ := strings.Cut(peerToolID, ":")
toolRef := reference
if strings.HasPrefix(ref, "./") || strings.HasPrefix(ref, "../") {
relPath, err := filepath.Rel(peerTool.WorkingDir, ref)
if !strings.HasPrefix(peerTool.Source.Location, "http://") && !strings.HasPrefix(peerTool.Source.Location, "https://") {
relPath, err := filepath.Rel(peerTool.WorkingDir, peerTool.Source.Location)
if err != nil {
return nil, err
}
Expand Down

0 comments on commit e787154

Please sign in to comment.