Skip to content

Commit 13995c1

Browse files
committed
VersionBump : v4.4.0
1 parent bfe0d25 commit 13995c1

File tree

5 files changed

+36
-25
lines changed

5 files changed

+36
-25
lines changed

src/CodeOfChaos.CliArgsParser.Generators/CodeOfChaos.CliArgsParser.Generators.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
<!-- Main package name -->
1313
<PackageId>CodeOfChaos.CliArgsParser.Generators</PackageId>
14-
<Version>4.3.4</Version>
14+
<Version>4.4.0</Version>
1515
<Authors>Anna Sas</Authors>
1616
<Description>CliArgsParser is a library built around Dependency Injection to allow you to create CLI tools with ease</Description>
1717
<PackageProjectUrl>https://github.com/code-of-chaos/cs-code_of_chaos-cli_args_parser/</PackageProjectUrl>

src/CodeOfChaos.CliArgsParser.Library/CodeOfChaos.CliArgsParser.Library.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
<!-- Main package name -->
1010
<PackageId>CodeOfChaos.CliArgsParser.Library</PackageId>
11-
<Version>4.3.4</Version>
11+
<Version>4.4.0</Version>
1212
<Authors>Anna Sas</Authors>
1313
<Description>CliArgsParser is a library built around Dependency Injection to allow you to create CLI tools with ease</Description>
1414
<PackageProjectUrl>https://github.com/code-of-chaos/cs-code_of_chaos-cli_args_parser/</PackageProjectUrl>
@@ -34,6 +34,6 @@
3434
</ItemGroup>
3535

3636
<ItemGroup>
37-
<PackageReference Include="AterraEngine.Unions" Version="2.7.1" />
37+
<PackageReference Include="AterraEngine.Unions" Version="3.6.0" />
3838
</ItemGroup>
3939
</Project>

src/CodeOfChaos.CliArgsParser.Library/Shared/SemanticVersionDto.cs

Lines changed: 31 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -61,32 +61,29 @@ public void BumpVersion(VersionSection section) {
6161
return;
6262
}
6363

64+
case VersionSection.Preview when Preview is null: {
65+
SemanticVersionDto newVersion = FromInput("Please enter a semantic version for the new preview version:");
66+
67+
Major = newVersion.Major;
68+
Minor = newVersion.Minor;
69+
Patch = newVersion.Patch;
70+
Preview = newVersion.Preview ?? 0 ;
71+
return;
72+
}
73+
6474
case VersionSection.Preview: {
65-
Preview ??= 0;
6675
Preview += 1;
6776
return;
6877
}
6978

7079
case VersionSection.Manual: {
71-
// Ask the user for input
72-
int tries = 0;
73-
while (tries <= 5) {
74-
Console.WriteLine("Please enter a semantic version:");
75-
string? input = Console.ReadLine();
76-
if (input is null || !TryParse(input, out SemanticVersionDto? newVersion)) {
77-
Console.WriteLine("Invalid input");
78-
tries++;
79-
continue;
80-
}
81-
82-
Major = newVersion.Major;
83-
Minor = newVersion.Minor;
84-
Patch = newVersion.Patch;
85-
Preview = newVersion.Preview;
86-
return;
87-
}
88-
89-
throw new Exception("Could not parse version after 5 tries.");
80+
SemanticVersionDto newVersion = FromInput();
81+
82+
Major = newVersion.Major;
83+
Minor = newVersion.Minor;
84+
Patch = newVersion.Patch;
85+
Preview = newVersion.Preview;
86+
return;
9087
}
9188

9289
// We don't care
@@ -99,4 +96,18 @@ public void BumpVersion(VersionSection section) {
9996
public override string ToString() => Preview is not null
10097
? $"{Major}.{Minor}.{Patch}-preview.{Preview}"
10198
: $"{Major}.{Minor}.{Patch}";
99+
100+
private static SemanticVersionDto FromInput(string inputText = "Please enter a semantic version:") {
101+
int tries = 0;
102+
while (tries <= 5) {
103+
Console.WriteLine(inputText);
104+
string? input = Console.ReadLine();
105+
if (input is not null && TryParse(input, out SemanticVersionDto? newVersion)) return newVersion;
106+
107+
Console.WriteLine("Invalid input");
108+
tries++;
109+
}
110+
111+
throw new Exception("Could not parse version after 5 tries.");
112+
}
102113
}

src/CodeOfChaos.CliArgsParser/CodeOfChaos.CliArgsParser.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
<!-- Main package name -->
99
<PackageId>CodeOfChaos.CliArgsParser</PackageId>
10-
<Version>4.3.4</Version>
10+
<Version>4.4.0</Version>
1111
<Authors>Anna Sas</Authors>
1212
<Description>CliArgsParser is a library built around Dependency Injection to allow you to create CLI tools with ease</Description>
1313
<PackageProjectUrl>https://github.com/code-of-chaos/cs-code_of_chaos-cli_args_parser/</PackageProjectUrl>

tests/Tests.CodeOfChaos.CliArgsParser/Tests.CodeOfChaos.CliArgsParser.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<ItemGroup>
1313
<PackageReference Include="JetBrains.Annotations" Version="2024.3.0"/>
1414
<PackageReference Include="Moq" Version="4.20.72"/>
15-
<PackageReference Include="TUnit" Version="0.6.15"/>
15+
<PackageReference Include="TUnit" Version="0.6.55" />
1616
<PackageReference Include="Bogus" Version="35.6.1"/>
1717
</ItemGroup>
1818

0 commit comments

Comments
 (0)