From 295b9db113058d33306f9f599d8077710a293f43 Mon Sep 17 00:00:00 2001 From: Julius Marminge Date: Thu, 4 Jun 2026 20:12:42 -0700 Subject: [PATCH] dont fail if env-file is unspecified --- infra/relay/scripts/deploy.ts | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/infra/relay/scripts/deploy.ts b/infra/relay/scripts/deploy.ts index 8b5f713d9a83e12971ab9b48d4fa32c402518628..b2d1ecf0e87e0c454371e7f93aac5f694f8451c0 100644 --- a/infra/relay/scripts/deploy.ts +++ b/infra/relay/scripts/deploy.ts @@ -74,9 +74,14 @@ const loadDeployConfigProvider = Effect.fn("relay.deploy.loadConfigProvider")(fu ) { const path = yield* Path.Path; const root = yield* relayRoot; - const selectedEnvFile = Option.getOrUndefined(envFileOverride); - const envFile = selectedEnvFile ? path.resolve(root, selectedEnvFile) : path.join(root, ".env"); - return yield* ConfigProvider.fromDotEnv({ path: envFile }); + + if (Option.isSome(envFileOverride)) { + return yield* ConfigProvider.fromDotEnv({ path: path.resolve(root, envFileOverride.value) }); + } + + return yield* ConfigProvider.fromDotEnv({ path: path.join(root, ".env") }).pipe( + Effect.catch(() => Effect.succeed(ConfigProvider.fromEnv())), + ); }); const relayDeployStage = Config.nonEmptyString("stage").pipe( @@ -184,7 +189,9 @@ export const relayDeployCommand = Command.make( Flag.withDefault(false), ), envFile: Flag.string("env-file").pipe( - Flag.withDescription("Environment file to load. Defaults to infra/relay/.env."), + Flag.withDescription( + "Environment file to load. Defaults to infra/relay/.env with process env fallback.", + ), Flag.optional, ), stage: Flag.string("stage").pipe( -- 2.54.0