Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove obsolete SL v1 implementation CLI check #426

Merged
merged 1 commit into from
Aug 28, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 3 additions & 40 deletions src/dotnet-nugetize/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
using System.Threading;
using System.Threading.Tasks;
using System.Xml.Linq;
using Devlooped;
using Mono.Options;
using Spectre.Console;
using Spectre.Console.Rendering;
Expand All @@ -29,46 +28,10 @@ class Program
string items;
List<string> extra;

static async Task<int> Main(string[] args)
static int Main(string[] args)
{
var status = SponsorCheck.CheckAsync(Directory.GetCurrentDirectory(), "devlooped", "NuGetizer", "dotnet-nugetize", ThisAssembly.Project.Version);
var result = new Program().Run(args);

// No need to check sponsorlink status if we couldn't render useful results.
if (result == 0)
{
var value = await status;
if (value == null)
return result;

switch (value.Value)
{
case SponsorStatus.AppMissing:
Warning(
AppMissing.Header,
new Markup(AppMissing.Message1("NuGetizer", "devlooped")),
new Grid().AddColumns(2)
.AddRow(
new Markup(AppMissing.Message2),
new Text("https://github.com/apps/sponsorlink",
new Style(Color.Blue, decoration: Decoration.Underline, link: "https://github.com/apps/sponsorlink"))));
break;
case SponsorStatus.NotSponsoring:
Warning(
NotSponsoring.Header,
new Markup(NotSponsoring.Message("NuGetizer")),
new Text("https://github.com/sponsors/devlooped",
new Style(Color.Blue, decoration: Decoration.Underline, link: "https://github.com/apps/sponsorlink")));
break;
case SponsorStatus.Sponsoring:
AnsiConsole.Write(new Markup($":heart_decoration: [grey30]{Sponsoring.Message("NuGetizer", "devlooped")}[/]"));
break;
default:
break;
}
}

return result;
Console.OutputEncoding = Encoding.Unicode;
return new Program().Run(args);
}

int Run(string[] args)
Expand Down