@@ -21,16 +21,20 @@ protected override StepResult HandleResult(string result, Queue<ConfigInitWizard
21
21
steps . Enqueue ( new PickBranchingStrategyStep ( ) ) ;
22
22
return StepResult . Ok ( ) ;
23
23
24
- case "3 " :
25
- steps . Enqueue ( new ConfigureBranches ( ) ) ;
24
+ case "4 " :
25
+ steps . Enqueue ( new SetNextVersion ( ) ) ;
26
26
return StepResult . Ok ( ) ;
27
+
27
28
case "4" :
28
- steps . Enqueue ( new GlobalModeSetting ( new EditConfigStep ( ) , false ) ) ;
29
+ steps . Enqueue ( new ConfigureBranches ( ) ) ;
29
30
return StepResult . Ok ( ) ;
30
31
case "5" :
31
- steps . Enqueue ( new AssemblyVersioningSchemeSetting ( ) ) ;
32
+ steps . Enqueue ( new GlobalModeSetting ( new EditConfigStep ( ) , false ) ) ;
32
33
return StepResult . Ok ( ) ;
33
34
case "6" :
35
+ steps . Enqueue ( new AssemblyVersioningSchemeSetting ( ) ) ;
36
+ return StepResult . Ok ( ) ;
37
+ case "7" :
34
38
steps . Enqueue ( new SetupBuildScripts ( ) ) ;
35
39
return StepResult . Ok ( ) ;
36
40
}
@@ -46,15 +50,46 @@ protected override string GetPrompt(Config config, string workingDirectory, IFil
46
50
47
51
2) Run getting started wizard
48
52
49
- 3) Branch specific configuration
50
- 4) Branch Increment mode (per commit/after tag) (Current: {0})
51
- 5) Assembly versioning scheme (Current: {1})
52
- 6) Setup build scripts" , config . VersioningMode , config . AssemblyVersioningScheme ) ;
53
+ 3) Set next version number
54
+ 4) Branch specific configuration
55
+ 5) Branch Increment mode (per commit/after tag) (Current: {0})
56
+ 6) Assembly versioning scheme (Current: {1})
57
+ 7) Setup build scripts" , config . VersioningMode , config . AssemblyVersioningScheme ) ;
53
58
}
54
59
55
60
protected override string DefaultResult
56
61
{
57
62
get { return null ; }
58
63
}
59
64
}
65
+
66
+ public class SetNextVersion : ConfigInitWizardStep
67
+ {
68
+ protected override StepResult HandleResult ( string result , Queue < ConfigInitWizardStep > steps , Config config , string workingDirectory , IFileSystem fileSystem )
69
+ {
70
+ if ( string . IsNullOrEmpty ( result ) )
71
+ {
72
+ steps . Enqueue ( new EditConfigStep ( ) ) ;
73
+ return StepResult . Ok ( ) ;
74
+ }
75
+
76
+ SemanticVersion semVer ;
77
+ if ( ! SemanticVersion . TryParse ( result , string . Empty , out semVer ) )
78
+ return StepResult . InvalidResponseSelected ( ) ;
79
+
80
+ config . NextVersion = semVer . ToString ( "t" ) ;
81
+ steps . Enqueue ( new EditConfigStep ( ) ) ;
82
+ return StepResult . Ok ( ) ;
83
+ }
84
+
85
+ protected override string GetPrompt ( Config config , string workingDirectory , IFileSystem fileSystem )
86
+ {
87
+ return @"What would you like to set the next version to (enter nothing to cancel)?" ;
88
+ }
89
+
90
+ protected override string DefaultResult
91
+ {
92
+ get { throw new System . NotImplementedException ( ) ; }
93
+ }
94
+ }
60
95
}
0 commit comments