Skip to content

Commit

Permalink
Fixed path joins in environment script
Browse files Browse the repository at this point in the history
  • Loading branch information
albbus-stack committed Apr 21, 2024
1 parent f701007 commit 3816208
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions .github/scripts/env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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) => {
Expand All @@ -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) => {
Expand All @@ -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')
Expand Down

0 comments on commit 3816208

Please sign in to comment.