From b2b58bb17a2269e94c8d6541dd24dd9ffcbbc8c7 Mon Sep 17 00:00:00 2001 From: Nick Hale <4175918+njhale@users.noreply.github.com> Date: Mon, 15 Jul 2024 14:12:46 -0400 Subject: [PATCH] chore: set the run file env var when starting the ui Set the `UI_RUN_FILE` env var before starting the UI tool when a run file is provided; e.g. `gptscript --ui `. This tells the UI to use the file's run page as the landing page on start. Signed-off-by: Nick Hale <4175918+njhale@users.noreply.github.com> --- pkg/cli/gptscript.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/cli/gptscript.go b/pkg/cli/gptscript.go index 4820efd8..d7d57b36 100644 --- a/pkg/cli/gptscript.go +++ b/pkg/cli/gptscript.go @@ -371,7 +371,7 @@ func (r *GPTScript) Run(cmd *cobra.Command, args []string) (retErr error) { gptOpt.Env = append(gptOpt.Env, "GPTSCRIPT_SDKSERVER_CREDENTIAL_OVERRIDE="+strings.Join(r.CredentialOverride, ",")) } - args = append([]string{args[0]}, "--file="+file) + gptOpt.Env = append(gptOpt.Env, "UI_RUN_FILE="+file) if len(args) > 2 { args = append(args, args[2:]...)