From bad87975c1a3332d068d86eaa0e87708d34d9cb2 Mon Sep 17 00:00:00 2001 From: Peli de Halleux Date: Fri, 13 Dec 2024 04:15:14 +0000 Subject: [PATCH] =?UTF-8?q?refactor:=20=E2=99=BB=EF=B8=8F=20remove=20dotEn?= =?UTF-8?q?vPath=20from=20options=20and=20worker?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/cli/src/api.ts | 9 ++------- packages/cli/src/worker.ts | 7 +++---- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/packages/cli/src/api.ts b/packages/cli/src/api.ts index 7aa98b8b7..486442d93 100644 --- a/packages/cli/src/api.ts +++ b/packages/cli/src/api.ts @@ -25,14 +25,10 @@ export async function run( * GenAIScript generation options. */ options?: Partial & { - /** - * Path to the .env file - */ - dotEnvPath?: string /** * Environment variables to use for the operation. */ - env?: Record + envVars?: Record /** * The signal to use for aborting the operation. Terminates the worker thread. */ @@ -45,10 +41,9 @@ export async function run( if (!scriptId) throw new Error("scriptId is required") if (typeof files === "string") files = [files] - const { dotEnvPath, env, signal, ...rest } = options || {} + const { envVars, signal, ...rest } = options || {} const workerData = { type: "run", - dotEnvPath, scriptId, files: files || [], options: rest, diff --git a/packages/cli/src/worker.ts b/packages/cli/src/worker.ts index 79833b16b..c91c75b3a 100644 --- a/packages/cli/src/worker.ts +++ b/packages/cli/src/worker.ts @@ -3,11 +3,10 @@ import { runScriptInternal } from "./run" import { NodeHost } from "./nodehost" export async function worker() { - const { type, dotEnvPath, ...data } = workerData as { + const { type, ...data } = workerData as { type: string - dotEnvPath: string - } & object - await NodeHost.install(dotEnvPath) // Install NodeHost with environment options + } + await NodeHost.install(undefined) // Install NodeHost with environment options switch (type) { case "run": { const { scriptId, files, options } = data as {