From e6574a52c3412bf83db1ed3c4629ccbccd75f045 Mon Sep 17 00:00:00 2001 From: Nicolas Merget Date: Thu, 9 Apr 2026 08:12:52 +0200 Subject: [PATCH] fix: load environment variables only if .env file exists --- scripts/cache-figma-images.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/cache-figma-images.ts b/scripts/cache-figma-images.ts index 480c3597..12fae87f 100644 --- a/scripts/cache-figma-images.ts +++ b/scripts/cache-figma-images.ts @@ -31,7 +31,8 @@ const MDX_DIR = join(ROOT, 'content', 'pages', 'documentation', 'components'); const CACHE_DIR = join(ROOT, 'static', 'assets', 'figma-cache'); const MANIFEST_PATH = join(ROOT, 'static', 'assets', 'figma-cache', 'manifest.json'); -loadEnvFile(join(ROOT, '.env')); +const envPath = join(ROOT, '.env'); +if (existsSync(envPath)) loadEnvFile(envPath); const FIGMA_TOKEN = process.env.FIGMA_TOKEN; if (!FIGMA_TOKEN) {