From 439e85b8aaa5cb9b80962ffaeb0b99952af55ccc Mon Sep 17 00:00:00 2001 From: RostiMelk Date: Wed, 8 Jan 2025 15:35:10 +0100 Subject: [PATCH] feat: skip dirs without env template --- packages/@sanity/cli/src/util/remoteTemplate.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/@sanity/cli/src/util/remoteTemplate.ts b/packages/@sanity/cli/src/util/remoteTemplate.ts index 992837060dc..17acc20a08f 100644 --- a/packages/@sanity/cli/src/util/remoteTemplate.ts +++ b/packages/@sanity/cli/src/util/remoteTemplate.ts @@ -217,9 +217,11 @@ export async function applyEnvVariables( await access(join(root, file)) return file }), - ).catch(() => { - throw new Error('Could not find .env.template, .env.example or .env.local.example file') - }) + ).catch(() => undefined) + + if (!templatePath) { + return // No template .env file found, skip + } try { const templateContent = await readFile(join(root, templatePath), 'utf8')