Skip to content

Commit

Permalink
Handle blank lines in front-end .env file
Browse files Browse the repository at this point in the history
  • Loading branch information
brundonsmith committed Dec 6, 2023
1 parent be31d28 commit 58eddd6
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion front-end/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@ const minify = process.argv.includes('--minify');
try {
const contents = (await fs.readFile('.env')).toString('utf-8')
dotEnvEntries = contents.split('\n')
.filter(line => !line.trim().startsWith('#'))
.filter(line =>
!line.trim().startsWith('#') &&
line.length >= 3 &&
line.includes('='))
.map(line => line.split('='))
} catch {
dotEnvEntries = []
Expand Down

0 comments on commit 58eddd6

Please sign in to comment.