Skip to content

Commit

Permalink
Add check for comments and empty lines in .env file
Browse files Browse the repository at this point in the history
  • Loading branch information
MuhammadUsama-afk-equinor authored and UsamaEquinorAFK committed Feb 16, 2024
1 parent 4ad59b1 commit 34c5577
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions backend/api/Configurations/ConfigurationBuilderExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ public static void AddDotEnvironmentVariables(this WebApplicationBuilder builder
'=',
StringSplitOptions.RemoveEmptyEntries);

if (parts.Length == 0 || parts[0].StartsWith('#'))
continue;

Environment.SetEnvironmentVariable(parts[0], parts[1]);
}

Expand Down

0 comments on commit 34c5577

Please sign in to comment.