From 3816208cee734672087168ee55ed97d073929b11 Mon Sep 17 00:00:00 2001 From: Alberto Del Buono Paolini Date: Sun, 21 Apr 2024 22:58:13 +0000 Subject: [PATCH] Fixed path joins in environment script --- .github/scripts/env.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/scripts/env.ts b/.github/scripts/env.ts index 6ba496fc9..50b16eeeb 100644 --- a/.github/scripts/env.ts +++ b/.github/scripts/env.ts @@ -14,7 +14,7 @@ const autogeneratedComment = const outputName = '.env.local' // Read the .env file -const envFilePath = path.join(__dirname, '../../' + outputName) +const envFilePath = path.join(__dirname, '..', '..', outputName) if (!fs.existsSync(envFilePath)) { console.log('🛑 .env.local file does not exist') process.exit(0) @@ -24,7 +24,7 @@ const envFileContent = fs.readFileSync(envFilePath, 'utf8') /** * Generate Expo .env file content */ -const expoOutputPath = path.join(__dirname, '../../apps/expo', outputName) +const expoOutputPath = path.join(__dirname, '..', '..', 'apps', 'expo', outputName) const expoFileContent = envFileContent .split('\n') .map((line) => { @@ -39,7 +39,7 @@ fs.writeFileSync(expoOutputPath, `${autogeneratedComment}\n${expoFileContent}\n$ /** * Generate Next.js .env file content */ -const nextOutputPath = path.join(__dirname, '../../apps/next', outputName) +const nextOutputPath = path.join(__dirname, '..', '..', 'apps', 'next', outputName) const nextFileContent = envFileContent .split('\n') .map((line) => { @@ -53,7 +53,7 @@ fs.writeFileSync(nextOutputPath, `${autogeneratedComment}\n${nextFileContent}`) /** * Generate Cloudflare Wrangler .dev.vars file content */ -const wranglerOutputPath = path.join(__dirname, '../../packages/api', '.dev.vars') +const wranglerOutputPath = path.join(__dirname, '..', '..', 'packages', 'api', '.dev.vars') // Remove public variables from output const wranglerFileContent = envFileContent .split('\n')