mirror of
https://github.com/whoswhip/Sharpbin.git
synced 2026-12-06 02:48:43 +00:00
fix(dotenv): skip empty lines and comments when loading environment variables
This commit is contained in:
@@ -12,6 +12,8 @@ namespace SharpbinV3.Server
|
|||||||
|
|
||||||
foreach (var line in File.ReadAllLines(filePath))
|
foreach (var line in File.ReadAllLines(filePath))
|
||||||
{
|
{
|
||||||
|
if (string.IsNullOrWhiteSpace(line) || line.StartsWith("#"))
|
||||||
|
continue;
|
||||||
var parts = line.Split('=', StringSplitOptions.RemoveEmptyEntries);
|
var parts = line.Split('=', StringSplitOptions.RemoveEmptyEntries);
|
||||||
|
|
||||||
if (parts.Length != 2)
|
if (parts.Length != 2)
|
||||||
|
|||||||
Reference in New Issue
Block a user