We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5a5c1d9 commit 3bdb4beCopy full SHA for 3bdb4be
exec.go
@@ -6,8 +6,10 @@ import (
6
"encoding/json"
7
"fmt"
8
"io"
9
+ "log/slog"
10
"os"
11
"os/exec"
12
+ "path/filepath"
13
"strings"
14
)
15
@@ -312,7 +314,16 @@ func concatTools(tools []fmt.Stringer) string {
312
314
313
315
func getCommand() string {
316
if gptScriptBin := os.Getenv("GPTSCRIPT_BIN"); gptScriptBin != "" {
- return gptScriptBin
317
+ if filepath.IsAbs(gptScriptBin) {
318
+ return gptScriptBin
319
+ }
320
+ cwd, err := os.Getwd()
321
+ if err != nil {
322
+ slog.Warn("failed to get cwd", "err", err.Error())
323
324
325
+
326
+ return filepath.Join(cwd, gptScriptBin)
327
}
328
329
return "gptscript"
0 commit comments