-
Notifications
You must be signed in to change notification settings - Fork 21
Open
Description
Hi, thanks for this project.
This is my case :
input :
#region Licensing
// Copyright (c) XXX
// All rights reserved.
#endregion
#region Usings
using System.Diagnostics;
#endregion
namespace X.XX.Web.Api.Bases;
public static class DotEnv
{
public static void Load(string filePath, string? prefix)
{
if (!File.Exists(filePath)) return;
foreach (string line in File.ReadAllLines(filePath))
{
string[] parts = line.Split(
'=',
StringSplitOptions.RemoveEmptyEntries);
if (parts.Length != 2) continue;
Trace.WriteLine($"DotEnv {parts[0]} = {parts[1]}");
Environment.SetEnvironmentVariable($"{prefix}{parts[0]}", parts[1]);
}
}
}
output :
#region Licensing
// Copyright (c) XXX
// All rights reserved.
#endregion
#region Usings
using System.Diagnostics;
#endregion
namespace X.XX.Web.Api.Bases;
/// <summary>
/// The dot env class
/// </summary>
public static class DotEnv
{
/// <summary>
/// Loads the file path
/// </summary>
/// <param name="filePath">The file path</param>
/// <param name="prefix">The prefix</param>
public static void Load(string filePath, string? prefix)
{
if (!File.Exists(filePath)) return;
foreach (string line in File.ReadAllLines(filePath))
{
string[] parts = line.Split(
'=',
StringSplitOptions.RemoveEmptyEntries);
if (parts.Length != 2) continue;
Trace.WriteLine($"DotEnv {parts[0]} = {parts[1]}");
Environment.SetEnvironmentVariable($"{prefix}{parts[0]}", parts[1]);
}
}
}
problem :
We can see the summary of the class has new lines, and breaks C# Xml doc, at least on vs22.
/// <summary>
/// The dot env class
/// </summary>
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels