Skip to content

Commit 4f127bc

Browse files
committed
Whole combined solution now builds
1 parent 277bc57 commit 4f127bc

24 files changed

Lines changed: 127 additions & 71 deletions

src/core/Statiq.App/Commands/BaseCommand{TSettings}.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,9 @@ protected BaseCommand(
4040

4141
public IFileSystem FileSystem { get; }
4242

43-
public sealed override async Task<int> ExecuteAsync(CommandContext context, TSettings commandSettings,
43+
public sealed override async Task<int> ExecuteAsync(
44+
CommandContext context,
45+
TSettings commandSettings,
4446
CancellationToken cancellationToken = default)
4547
{
4648
// Set verbose tracing

src/core/Statiq.App/Commands/EngineCommand{TSettings}.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,14 @@ protected EngineCommand(
2525

2626
public Settings Settings { get; }
2727

28-
public override sealed async Task<int> ExecuteCommandAsync(CommandContext commandContext, TSettings commandSettings)
28+
public override sealed async Task<int> ExecuteCommandAsync(CommandContext context, TSettings commandSettings)
2929
{
3030
// We need to get the engine command settings to pass to the engine manager
3131
// First try the actual command settings
3232
if (!(commandSettings is EngineCommandSettings engineCommandSettings))
3333
{
3434
// Then try the command data or create one and either way copy over the base command settings
35-
engineCommandSettings = commandContext.Data as EngineCommandSettings ?? new EngineCommandSettings();
35+
engineCommandSettings = context.Data as EngineCommandSettings ?? new EngineCommandSettings();
3636
engineCommandSettings.LogLevel = commandSettings.LogLevel;
3737
engineCommandSettings.Attach = commandSettings.Debug;
3838
engineCommandSettings.Debug = commandSettings.Attach;
@@ -43,13 +43,13 @@ public override sealed async Task<int> ExecuteCommandAsync(CommandContext comman
4343
// Once the engine manager is created, the configuration settings cannot be used (they will have been copied over)
4444
using (EngineManager engineManager =
4545
new EngineManager(
46-
commandContext,
46+
context,
4747
engineCommandSettings,
4848
Settings,
4949
ServiceCollection,
5050
Bootstrapper))
5151
{
52-
return await ExecuteEngineAsync(commandContext, commandSettings, engineManager);
52+
return await ExecuteEngineAsync(context, commandSettings, engineManager);
5353
}
5454
}
5555

src/core/Statiq.App/Commands/GlobEvalCommand.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@ namespace Statiq.App
1515
[Description("Evaluates a globbing pattern against an existing path.")]
1616
public class GlobEvalCommand : Command<GlobEvalCommandSettings>
1717
{
18-
public override int Execute(CommandContext context, GlobEvalCommandSettings settings,
18+
public override int Execute(
19+
CommandContext context,
20+
GlobEvalCommandSettings settings,
1921
CancellationToken cancellationToken = default)
2022
{
2123
// Make sure path is absolute
@@ -60,4 +62,4 @@ private class FileSystem : IFileSystem
6062
IFileWriteTracker IReadOnlyFileSystem.WriteTracker => throw new NotImplementedException();
6163
}
6264
}
63-
}
65+
}

src/core/Statiq.App/Commands/GlobTestCommand.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@ namespace Statiq.App
1111
[Description("Tests a globbing pattern against a sample path.")]
1212
public class GlobTestCommand : Command<GlobTestCommandSettings>
1313
{
14-
public override int Execute(CommandContext context, GlobTestCommandSettings settings,
14+
public override int Execute(
15+
CommandContext context,
16+
GlobTestCommandSettings settings,
1517
CancellationToken cancellationToken = default)
1618
{
1719
// Make sure path is absolute
@@ -40,4 +42,4 @@ public override int Execute(CommandContext context, GlobTestCommandSettings sett
4042
return 0;
4143
}
4244
}
43-
}
45+
}

src/core/Statiq.Core/Modules/Content/AddContentToMetadata.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
using System.Collections.Generic;
33
using System.Collections.Immutable;
44
using System.Linq;
5+
using System.Threading;
56
using System.Threading.Tasks;
67
using Statiq.Common;
78

@@ -55,7 +56,7 @@ protected override async Task<IEnumerable<IDocument>> ExecuteChildrenAsync(
5556

5657
object content = childOutputs.Length == 1
5758
? (object)await childOutputs[0].GetContentStringAsync()
58-
: await childOutputs.ToAsyncEnumerable().SelectAwait(async x => await x.GetContentStringAsync()).ToArrayAsync();
59+
: await childOutputs.ToAsyncEnumerable().Select(async (IDocument x, CancellationToken _) => await x.GetContentStringAsync()).ToArrayAsync();
5960

6061
return context.Inputs.Select(input => input.Clone(new MetadataItems { { _key, content } }));
6162
}

src/core/Statiq.Core/Modules/Content/InsertLinks.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ public InsertLinks WithEndWordSeparators(params char[] endWordSeparators)
150150
foreach (IElement element in htmlDocument.QuerySelectorAll(_querySelector).Where(t => !t.Ancestors<IHtmlAnchorElement>().Any()))
151151
{
152152
// Enumerate all descendant text nodes not already in a link element
153-
foreach (IText text in element.Descendents().OfType<IText>().Where(t => !t.Ancestors<IHtmlAnchorElement>().Any()))
153+
foreach (IText text in element.Descendants().OfType<IText>().Where(t => !t.Ancestors<IHtmlAnchorElement>().Any()))
154154
{
155155
if (ReplaceStrings(text, links, out string newText))
156156
{

src/core/Statiq.Core/Modules/Control/GroupDocuments.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
using System.Collections.Generic;
33
using System.Collections.Immutable;
44
using System.Linq;
5+
using System.Threading;
56
using System.Threading.Tasks;
67
using Statiq.Common;
78

@@ -93,7 +94,7 @@ protected override async Task<IEnumerable<IDocument>> ExecuteContextAsync(IExecu
9394
{
9495
List<(IDocument Document, IEnumerable<object> Keys)> groups = await context.Inputs
9596
.ToAsyncEnumerable()
96-
.SelectAwait(async x => (Document: x, Keys: await _key.GetValueAsync(x, context)))
97+
.Select(async (IDocument x, CancellationToken _) => (Document: x, Keys: await _key.GetValueAsync(x, context)))
9798
.ToListAsync();
9899

99100
return groups

src/core/Statiq.Core/Modules/IO/MirrorResources.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
using System.Linq;
55
using System.Net;
66
using System.Net.Http;
7+
using System.Threading;
78
using System.Threading.Tasks;
89
using AngleSharp.Dom;
910
using AngleSharp.Html.Dom;
@@ -73,7 +74,7 @@ public MirrorResources(Func<Uri, NormalizedPath> pathFunc)
7374
// Iterate the input documents synchronously so we don't download the same resource more than once
7475
return await context.Inputs
7576
.ToAsyncEnumerable()
76-
.SelectAwait(async x => await GetDocumentAsync(x))
77+
.Select(async (Common.IDocument x, CancellationToken _) => await GetDocumentAsync(x))
7778
.ToListAsync();
7879

7980
async Task<Common.IDocument> GetDocumentAsync(Common.IDocument input)

src/core/Statiq.Core/Modules/IO/SetDestination.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,8 @@ public SetDestination(Config<NormalizedPath> destination, bool ignoreMetadata =
117117
path = await destination.GetValueAsync(doc, ctx);
118118
}
119119
return path;
120-
}), true)
120+
}),
121+
true)
121122
{
122123
destination.ThrowIfNull(nameof(destination));
123124
}

src/core/Statiq.Core/Modules/Metadata/CreateTree.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
using System.Collections.Immutable;
55
using System.Collections.ObjectModel;
66
using System.Linq;
7+
using System.Threading;
78
using System.Threading.Tasks;
89
using Statiq.Common;
910

@@ -175,8 +176,8 @@ protected override async Task<IEnumerable<IDocument>> ExecuteContextAsync(IExecu
175176
TreeNodeEqualityComparer treeNodeEqualityComparer = new TreeNodeEqualityComparer();
176177
Dictionary<string[], TreeNode> nodesDictionary = await context.Inputs
177178
.ToAsyncEnumerable()
178-
.SelectAwait(async input => new TreeNode(await _treePath.GetValueAsync(input, context), input))
179-
.Where(x => x.TreePath is object)
179+
.Select(async (IDocument input, CancellationToken _) => new TreeNode(await _treePath.GetValueAsync(input, context), input))
180+
.Where(x => x.TreePath != null)
180181
.Distinct(treeNodeEqualityComparer)
181182
.ToDictionaryAsync(x => x.TreePath, new TreePathEqualityComparer());
182183

0 commit comments

Comments
 (0)