Compare commits
2 Commits
v0.4.0
...
v0.6.0-RC.
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7b7fafbce9 | ||
|
|
8a8b16c655 |
@@ -25,11 +25,18 @@ namespace Cli
|
||||
var repoBasePath = await GetRepoBasePath(workingDir);
|
||||
var chosenService = await ChooseService(repoBasePath);
|
||||
var selection = await SelectVersion(repoBasePath, chosenService);
|
||||
await AddVersionTagToRepo(repoBasePath, selection.Version.ToString());
|
||||
await PushTagsToRemote(repoBasePath);
|
||||
await PushCommitsToRemote(repoBasePath);
|
||||
|
||||
await AnsiConsole.Status()
|
||||
.StartAsync("pushing to remote...", async _ =>
|
||||
{
|
||||
await AddVersionTagToRepo(repoBasePath, selection.Version.ToString());
|
||||
await PushTagsToRemote(repoBasePath);
|
||||
await PushCommitsToRemote(repoBasePath);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
private async Task<string> GetRepoBasePath(string workingDir)
|
||||
{
|
||||
var repoBasePath = "";
|
||||
|
||||
@@ -6,10 +6,11 @@
|
||||
<RootNamespace>Cli</RootNamespace>
|
||||
<PackAsTool>true</PackAsTool>
|
||||
<ToolCommandName>update-tag</ToolCommandName>
|
||||
<AssemblyTitle>update-tag</AssemblyTitle>
|
||||
<PackageId>Novaloop.UpdateTag</PackageId>
|
||||
<title>Updates the tag of a repo to the next chosen version according the semver symantic.</title>
|
||||
<PackageTags>semver;update-tag;tag;git</PackageTags>
|
||||
<Version>0.4.0</Version>
|
||||
<Version>0.5.0</Version>
|
||||
<Authors>Matthias Langhard</Authors>
|
||||
<Company>Novaloop AG</Company>
|
||||
<PackageProjectUrl>https://gitlab.com/novaloop-oss/novaloop.update-tag</PackageProjectUrl>
|
||||
@@ -18,6 +19,7 @@
|
||||
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="CommandLineParser" Version="2.8.0"/>
|
||||
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="5.0.2"/>
|
||||
<PackageReference Include="Microsoft.Extensions.Hosting" Version="5.0.0"/>
|
||||
<PackageReference Include="Spectre.Console" Version="0.42.0"/>
|
||||
|
||||
10
src/Cli/Models/CliParams.cs
Normal file
10
src/Cli/Models/CliParams.cs
Normal file
@@ -0,0 +1,10 @@
|
||||
using CommandLine;
|
||||
|
||||
namespace Cli.Models
|
||||
{
|
||||
public class CliParams
|
||||
{
|
||||
[Option('r', "repository-path", Required = false, HelpText = "Run update-tag on a git repository other than the current directory.")]
|
||||
public string RepositoryPath { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,8 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Application;
|
||||
using Cli.Models;
|
||||
using CommandLine;
|
||||
using Infrastructure;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.Hosting;
|
||||
@@ -21,9 +22,14 @@ namespace Cli
|
||||
.ServiceProvider
|
||||
.GetRequiredService<AppRunner>();
|
||||
|
||||
await appRunner.Run(args.FirstOrDefault() ?? Environment.CurrentDirectory);
|
||||
await Parser.Default
|
||||
.ParseArguments<CliParams>(args)
|
||||
.WithParsedAsync(
|
||||
async options => { await appRunner.Run(options.RepositoryPath ?? Environment.CurrentDirectory); }
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
private static IHostBuilder CreateHostBuilder()
|
||||
{
|
||||
return Host.CreateDefaultBuilder()
|
||||
|
||||
Reference in New Issue
Block a user