Skip to content

Commit

Permalink
fixed execution
Browse files Browse the repository at this point in the history
fixed default value overriding json configuration
  • Loading branch information
Doraku committed Oct 10, 2024
1 parent 9bea682 commit cfe6a00
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Release.bat
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
DEL /q package
dotnet clean source -c Release

dotnet test source -c Release -r build
dotnet test source -c Release

IF %ERRORLEVEL% GTR 0 GOTO :end

Expand Down
6 changes: 4 additions & 2 deletions source/DefaultDocumentation.Common/Generator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,9 @@ private void AddSetting<TSetting, TConfig>(
_configuration.Property(name, StringComparison.OrdinalIgnoreCase)?.Remove();
_configuration.Add(name, JToken.FromObject(convert(value)!, _serializer));
}
else if (!Equals(defaultValue, default(TConfig)))
else if (!Equals(defaultValue, default(TConfig))
&& (!(_configuration.Property(name, StringComparison.OrdinalIgnoreCase) is { } configurationProperty)
|| configurationProperty.Value?.Type is null or JTokenType.Null))
{
_configuration.Property(name, StringComparison.OrdinalIgnoreCase)?.Remove();
_configuration.Add(name, JToken.FromObject(defaultValue!, _serializer));
Expand Down Expand Up @@ -154,7 +156,7 @@ private void WriteLinks()

using StreamWriter writer = _context.Settings.LinksOutputFile.CreateText();

PageContext context = new(_context, new ExternDocItem("", "", ""));
PageContext context = new(_context, new ExternDocItem("T:", "", ""));

writer.WriteLine(_context.Settings.LinksBaseUrl);
foreach (DocItem item in _context.Items.Values.Where(i => i is not ExternDocItem and not AssemblyDocItem and not TypeParameterDocItem and not ParameterDocItem))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public GeneralContext(

foreach (KeyValuePair<Type, Context> pair in _contexts)
{
Settings.Logger.Info($"FileNameFactory that will be used for {pair.Key.Name}: {pair.Value.FileNameFactory!.GetType().AssemblyQualifiedName}");
Settings.Logger.Info($"FileNameFactory that will be used for {pair.Key.Name}: {pair.Value.FileNameFactory?.GetType().AssemblyQualifiedName}");
Settings.Logger.Info($"SectionWriter that will be used for {pair.Key.Name}:{string.Concat(pair.Value.Sections?.Select(s => $"{Environment.NewLine} {s.GetType().AssemblyQualifiedName}") ?? [])}");
}
}
Expand Down

0 comments on commit cfe6a00

Please sign in to comment.