Skip to content

Commit a76b32a

Browse files
authored
fix: load environment variables only if .env file exists (#294)
1 parent dbd8cf2 commit a76b32a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

scripts/cache-figma-images.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ const MDX_DIR = join(ROOT, 'content', 'pages', 'documentation', 'components');
3131
const CACHE_DIR = join(ROOT, 'static', 'assets', 'figma-cache');
3232
const MANIFEST_PATH = join(ROOT, 'static', 'assets', 'figma-cache', 'manifest.json');
3333

34-
loadEnvFile(join(ROOT, '.env'));
34+
const envPath = join(ROOT, '.env');
35+
if (existsSync(envPath)) loadEnvFile(envPath);
3536
const FIGMA_TOKEN = process.env.FIGMA_TOKEN;
3637

3738
if (!FIGMA_TOKEN) {

0 commit comments

Comments
 (0)