@@ -17,54 +17,60 @@ public partial class VersionBumpCommand : ICommand<VersionBumpParameters> {
17
17
// Methods
18
18
// -----------------------------------------------------------------------------------------------------------------
19
19
public async Task ExecuteAsync ( VersionBumpParameters parameters ) {
20
- Console . WriteLine ( "Bumping version..." ) ;
20
+ Console . WriteLine ( ConsoleTextStore . BumpingVersion ) ;
21
21
SuccessOrFailure < SemanticVersionDto > bumpResult = await BumpVersion ( parameters ) ;
22
22
if ( bumpResult is { IsFailure : true , AsFailure . Value : var errorBumping } ) {
23
- Console . WriteLine ( errorBumping ) ;
23
+ Console . WriteLine ( ConsoleTextStore . CommandEndFailure ( errorBumping ) ) ;
24
24
return ;
25
25
}
26
26
27
27
SemanticVersionDto updatedVersion = bumpResult . AsSuccess . Value ;
28
28
29
- Console . WriteLine ( "Git committing ..." ) ;
29
+ Console . WriteLine ( ConsoleTextStore . GitCommitting ) ;
30
30
SuccessOrFailure gitCommitResult = await GitHelpers . TryCreateGitCommit ( updatedVersion ) ;
31
31
if ( gitCommitResult is { IsFailure : true , AsFailure . Value : var errorCommiting } ) {
32
- Console . WriteLine ( errorCommiting ) ;
32
+ Console . WriteLine ( ConsoleTextStore . CommandEndFailure ( errorCommiting ) ) ;
33
33
return ;
34
34
}
35
+
36
+ // Ask the user for extra input to make sure they want to push the current tag.
37
+ if ( ! parameters . Force ) {
38
+ Console . WriteLine ( ConsoleTextStore . QuestionTagAndCommit ) ;
39
+ string ? input = Console . ReadLine ( ) ? . ToLowerInvariant ( ) ;
40
+ if ( input is not "y" ) {
41
+ Console . WriteLine ( ConsoleTextStore . CommandEndSuccess ( ) ) ;
42
+ return ;
43
+ }
44
+ }
35
45
36
- Console . WriteLine ( "Git tagging ..." ) ;
46
+ Console . WriteLine ( ConsoleTextStore . GitTagging ) ;
37
47
SuccessOrFailure gitTagResult = await GitHelpers . TryCreateGitTag ( updatedVersion ) ;
38
48
if ( gitTagResult is { IsFailure : true , AsFailure . Value : var errorTagging } ) {
39
- Console . WriteLine ( errorTagging ) ;
49
+ Console . WriteLine ( ConsoleTextStore . CommandEndFailure ( errorTagging ) ) ;
40
50
return ;
41
51
}
42
52
43
- Console . WriteLine ( $ "Version { updatedVersion } committed and tagged successfully." ) ;
53
+ Console . WriteLine ( ConsoleTextStore . TagSuccessful ( updatedVersion ) ) ;
44
54
45
- if ( ! parameters . PushToRemote ) return ;
46
-
47
- // Ask the user for extra input to make sure they want to push the current tag.
48
- if ( ! parameters . Force ) {
49
- Console . WriteLine ( "Do you want to push to origin? (y/n)" ) ;
50
- string ? input = Console . ReadLine ( ) ? . ToLowerInvariant ( ) ;
51
- if ( input is not "y" ) return ;
55
+ if ( ! parameters . PushToRemote ) {
56
+ Console . WriteLine ( ConsoleTextStore . CommandEndSuccess ( ) ) ;
57
+ return ;
52
58
}
53
59
54
- Console . WriteLine ( "Pushing to origin ..." ) ;
60
+ Console . WriteLine ( ConsoleTextStore . GitPushingToRemote ) ;
55
61
SuccessOrFailure pushResult = await GitHelpers . TryPushToOrigin ( ) ;
56
62
if ( pushResult is { IsFailure : true , AsFailure . Value : var errorPushing } ) {
57
- Console . WriteLine ( errorPushing ) ;
63
+ Console . WriteLine ( ConsoleTextStore . CommandEndFailure ( errorPushing ) ) ;
58
64
return ;
59
65
}
60
66
61
67
SuccessOrFailure pushTagsResult = await GitHelpers . TryPushTagsToOrigin ( ) ;
62
68
if ( pushTagsResult is { IsFailure : true , AsFailure . Value : var errorPushingTags } ) {
63
- Console . WriteLine ( errorPushingTags ) ;
69
+ Console . WriteLine ( ConsoleTextStore . CommandEndFailure ( errorPushingTags ) ) ;
64
70
return ;
65
71
}
66
72
67
- Console . WriteLine ( "Pushed to origin successfully." ) ;
73
+ Console . WriteLine ( ConsoleTextStore . CommandEndSuccess ( ) ) ;
68
74
}
69
75
70
76
@@ -104,7 +110,7 @@ private static async Task<SuccessOrFailure<SemanticVersionDto>> BumpVersion(Vers
104
110
}
105
111
106
112
versionElement . Value = versionDto . ToString ( ) ;
107
- Console . WriteLine ( $ "Updated version of package { projectName } to { versionElement . Value } " ) ;
113
+ Console . WriteLine ( ConsoleTextStore . UpdatedVersion ( projectName , versionElement . Value ) ) ;
108
114
}
109
115
110
116
return versionDto is not null
0 commit comments