Skip to content

Commit 9ee00d4

Browse files
Merge pull request #517 from ibuildthecloud/main
bug: fix regression in changing GPTSCRIPT_INPUT env var
2 parents e06fa92 + 85047e1 commit 9ee00d4

File tree

2 files changed

+10
-9
lines changed

2 files changed

+10
-9
lines changed

pkg/cli/gptscript.go

+9-8
Original file line numberDiff line numberDiff line change
@@ -45,14 +45,15 @@ type GPTScript struct {
4545
CacheOptions
4646
OpenAIOptions
4747
DisplayOptions
48-
Color *bool `usage:"Use color in output (default true)" default:"true"`
49-
Confirm bool `usage:"Prompt before running potentially dangerous commands"`
50-
Debug bool `usage:"Enable debug logging"`
51-
NoTrunc bool `usage:"Do not truncate long log messages"`
52-
Quiet *bool `usage:"No output logging (set --quiet=false to force on even when there is no TTY)" short:"q"`
53-
Output string `usage:"Save output to a file, or - for stdout" short:"o"`
54-
EventsStreamTo string `usage:"Stream events to this location, could be a file descriptor/handle (e.g. fd://2), filename, or named pipe (e.g. \\\\.\\pipe\\my-pipe)" name:"events-stream-to"`
55-
Input string `usage:"Read input from a file (\"-\" for stdin)" short:"f"`
48+
Color *bool `usage:"Use color in output (default true)" default:"true"`
49+
Confirm bool `usage:"Prompt before running potentially dangerous commands"`
50+
Debug bool `usage:"Enable debug logging"`
51+
NoTrunc bool `usage:"Do not truncate long log messages"`
52+
Quiet *bool `usage:"No output logging (set --quiet=false to force on even when there is no TTY)" short:"q"`
53+
Output string `usage:"Save output to a file, or - for stdout" short:"o"`
54+
EventsStreamTo string `usage:"Stream events to this location, could be a file descriptor/handle (e.g. fd://2), filename, or named pipe (e.g. \\\\.\\pipe\\my-pipe)" name:"events-stream-to"`
55+
// Input should not be using GPTSCRIPT_INPUT env var because that is the same value that is set in tool executions
56+
Input string `usage:"Read input from a file (\"-\" for stdin)" short:"f" env:"GPTSCRIPT_INPUT_FILE"`
5657
SubTool string `usage:"Use tool of this name, not the first tool in file" local:"true"`
5758
Assemble bool `usage:"Assemble tool to a single artifact, saved to --output" hidden:"true" local:"true"`
5859
ListModels bool `usage:"List the models available and exit" local:"true"`

pkg/engine/cmd.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ func appendInputAsEnv(env []string, input string) []string {
182182
}
183183
}
184184

185-
env = appendEnv(env, "GPTSCRIPT_INPUT_CONTENT", input)
185+
env = appendEnv(env, "GPTSCRIPT_INPUT", input)
186186
return env
187187
}
188188

0 commit comments

Comments
 (0)