Skip to content

Commit

Permalink
feat: Updated packages and global.json to .NET 8 (#52)
Browse files Browse the repository at this point in the history
  • Loading branch information
tadamczyk committed Nov 14, 2023
1 parent 1bf1918 commit 569f175
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 6 deletions.
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"sdk": {
"version": "8.0.100-rc.2.23502.2",
"version": "8.0.100",
"rollForward": "latestMajor",
"allowPrerelease": true
}
Expand Down
2 changes: 1 addition & 1 deletion src/Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
</PropertyGroup>
<ItemGroup>
<PackageVersion Include="Microsoft.Extensions.DependencyInjection" Version="8.0.0-rc.2.23479.6"/>
<PackageVersion Include="Microsoft.Extensions.DependencyInjection" Version="8.0.0"/>
<PackageVersion Include="Microsoft.SourceLink.GitHub" Version="1.1.1"/>
<PackageVersion Include="NuGet.ProjectModel" Version="6.7.0"/>
<PackageVersion Include="Spectre.Console.Cli" Version="0.47.0"/>
Expand Down
2 changes: 1 addition & 1 deletion src/DotNetWhy.Application/Cli.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ public static class Cli
ApplicationBuilder
.AddServices()
.AsTypeRegistrar()
.ForCommandApplication<DotNetWhyCommand>()
.ForCommandApplication<DotNetWhyCommand>("dotnet why")
.Run(args);
}
14 changes: 11 additions & 3 deletions src/DotNetWhy.Application/Infrastructure/ApplicationBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,15 @@ internal static class ApplicationBuilder
new TypeRegistrar(services);

public static ICommandApp ForCommandApplication<TCommand>(
this ITypeRegistrar typeRegistrar)
where TCommand : class, ICommand =>
new CommandApp<TCommand>(typeRegistrar);
this ITypeRegistrar typeRegistrar,
string applicationName = null)
where TCommand : class, ICommand
{
var commandApplication = new CommandApp<TCommand>(typeRegistrar);

if (!string.IsNullOrEmpty(applicationName))
commandApplication.Configure(configurator => configurator.SetApplicationName(applicationName));

return commandApplication;
}
}

0 comments on commit 569f175

Please sign in to comment.