Skip to content

Commit fd995f8

Browse files
committed
chore: make workspace path always absolute
Signed-off-by: Taylor Price <[email protected]>
1 parent f664d57 commit fd995f8

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

pkg/gptscript/gptscript.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import (
44
"context"
55
"fmt"
66
"os"
7+
"path/filepath"
78

89
"github.com/gptscript-ai/gptscript/pkg/builtin"
910
"github.com/gptscript-ai/gptscript/pkg/cache"
@@ -113,6 +114,12 @@ func (g *GPTScript) getEnv(env []string) ([]string, error) {
113114
if err != nil {
114115
return nil, err
115116
}
117+
} else if !filepath.IsAbs(g.WorkspacePath) {
118+
var err error
119+
g.WorkspacePath, err = filepath.Abs(g.WorkspacePath)
120+
if err != nil {
121+
return nil, err
122+
}
116123
}
117124
if err := os.MkdirAll(g.WorkspacePath, 0700); err != nil {
118125
return nil, err

0 commit comments

Comments
 (0)