Skip to content

Commit 043ebdd

Browse files
committed
Fixed build fail
1 parent 199a699 commit 043ebdd

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
namespace GitVersion.Configuration.Init
2+
{
3+
using System.Collections.Generic;
4+
using GitVersion.Configuration.Init.Wizard;
5+
using GitVersion.Helpers;
6+
7+
public class SetNextVersion : ConfigInitWizardStep
8+
{
9+
protected override StepResult HandleResult(string result, Queue<ConfigInitWizardStep> steps, Config config, string workingDirectory, IFileSystem fileSystem)
10+
{
11+
if (string.IsNullOrEmpty(result))
12+
{
13+
steps.Enqueue(new EditConfigStep());
14+
return StepResult.Ok();
15+
}
16+
17+
SemanticVersion semVer;
18+
if (!SemanticVersion.TryParse(result, string.Empty, out semVer))
19+
return StepResult.InvalidResponseSelected();
20+
21+
config.NextVersion = semVer.ToString("t");
22+
steps.Enqueue(new EditConfigStep());
23+
return StepResult.Ok();
24+
}
25+
26+
protected override string GetPrompt(Config config, string workingDirectory, IFileSystem fileSystem)
27+
{
28+
return @"What would you like to set the next version to (enter nothing to cancel)?";
29+
}
30+
31+
protected override string DefaultResult
32+
{
33+
get { throw new System.NotImplementedException(); }
34+
}
35+
}
36+
}

0 commit comments

Comments
 (0)