Skip to content

Commit

Permalink
Upgrade to .NET 8, update NuGet packages, version 1.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
LorenzCK committed Oct 18, 2024
1 parent e5987ad commit b3f7351
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 23 deletions.
24 changes: 14 additions & 10 deletions src/GitCoAuth/GitCoAuth.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net5.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>

<PackAsTool>true</PackAsTool>
<ToolCommandName>gitcoauth</ToolCommandName>
Expand All @@ -13,28 +13,32 @@
<Company />
<Product />
<PackageIconUrl>https://raw.githubusercontent.com/LorenzCK/github-coauth-tool/master/graphics/gitcoauth-logo-256.png</PackageIconUrl>
<PackageIconUrl>gitcoauth-logo-128.png</PackageIconUrl>
<PackageIcon>gitcoauth-logo-128.png</PackageIcon>
<RepositoryUrl>https://github.com/LorenzCK/github-coauth-tool</RepositoryUrl>
<PackageLicenseExpression>MIT</PackageLicenseExpression>

<Description>GitCoAuth is a simple .NET Core Global Tool that will help you generate co-authorship commit lines, as you should.

Run the tool passing in your co-author's GitHub username and it will generate the correct commit message trailer to add (and copy it to your clipboard).</Description>
<Description>
GitCoAuth is a simple .NET Core Global Tool that will help you generate co-authorship commit lines, as you should.

Run the tool passing in your co-author's GitHub username and it will generate the correct commit message trailer to add (and copy it to your clipboard).
</Description>
<PackageReleaseNotes></PackageReleaseNotes>
<PackageTags>global-tool global-tools github co-authored co-authoring commit git</PackageTags>
<PackageId>dotnet-gitcoauth</PackageId>
<Version>1.1.0</Version>
<AssemblyVersion>1.1.0</AssemblyVersion>
<FileVersion>1.1.0</FileVersion>
<Version>1.2.0</Version>
<AssemblyVersion>1.2.0</AssemblyVersion>
<FileVersion>1.2.0</FileVersion>
<PackageReadmeFile>README.md</PackageReadmeFile>
</PropertyGroup>

<ItemGroup>
<None Include="..\..\graphics\gitcoauth-logo-128.png" Pack="true" PackagePath="\" Link="gitcoauth-logo-128.png" />
<None Include="..\..\README.md" Pack="true" PackagePath="\"/>
</ItemGroup>

<ItemGroup>
<PackageReference Include="RestSharp" Version="107.3.0" />
<PackageReference Include="TextCopy" Version="6.1.0" />
<PackageReference Include="RestSharp" Version="112.1.0" />
<PackageReference Include="TextCopy" Version="6.2.1" />
</ItemGroup>

</Project>
9 changes: 7 additions & 2 deletions src/GitCoAuth/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ namespace GitCoAuth {

class Program {

class UserProfile {
public string Name { get; set; }
public string Email { get; set; }
}

async static Task<int> Main(string[] args) {
if(args.Length != 1) {
PrintHelp();
Expand All @@ -29,14 +34,14 @@ async static Task<int> Main(string[] args) {

private static void PrintHelp() {
Console.Error.WriteLine(" gitcoauth <username>");
Console.Error.WriteLine("Prints out a commit message trailer that indicates that GitHub user <username> contributed to a commit (and copied it to clipboard, if possible).");
Console.Error.WriteLine("Prints out a commit message trailer that indicates that GitHub user <username> contributed to a commit (and copies it to clipboard, if possible).");
}

private static async Task<(string Name, string Email)> GetUserData(string username) {
var client = new RestClient("https://api.github.com");

try {
var resp = await client.GetJsonAsync<UserProfile>($"/users/{username}");
var resp = await client.GetAsync<UserProfile>($"/users/{username}");

return (
resp.Name ?? username,
Expand Down
11 changes: 0 additions & 11 deletions src/GitCoAuth/UserProfile.cs

This file was deleted.

0 comments on commit b3f7351

Please sign in to comment.