@@ -17,54 +17,60 @@ public partial class VersionBumpCommand : ICommand<VersionBumpParameters> {
1717 // Methods
1818 // -----------------------------------------------------------------------------------------------------------------
1919 public async Task ExecuteAsync ( VersionBumpParameters parameters ) {
20- Console . WriteLine ( "Bumping version..." ) ;
20+ Console . WriteLine ( ConsoleTextStore . BumpingVersion ) ;
2121 SuccessOrFailure < SemanticVersionDto > bumpResult = await BumpVersion ( parameters ) ;
2222 if ( bumpResult is { IsFailure : true , AsFailure . Value : var errorBumping } ) {
23- Console . WriteLine ( errorBumping ) ;
23+ Console . WriteLine ( ConsoleTextStore . CommandEndFailure ( errorBumping ) ) ;
2424 return ;
2525 }
2626
2727 SemanticVersionDto updatedVersion = bumpResult . AsSuccess . Value ;
2828
29- Console . WriteLine ( "Git committing ..." ) ;
29+ Console . WriteLine ( ConsoleTextStore . GitCommitting ) ;
3030 SuccessOrFailure gitCommitResult = await GitHelpers . TryCreateGitCommit ( updatedVersion ) ;
3131 if ( gitCommitResult is { IsFailure : true , AsFailure . Value : var errorCommiting } ) {
32- Console . WriteLine ( errorCommiting ) ;
32+ Console . WriteLine ( ConsoleTextStore . CommandEndFailure ( errorCommiting ) ) ;
3333 return ;
3434 }
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+ }
3545
36- Console . WriteLine ( "Git tagging ..." ) ;
46+ Console . WriteLine ( ConsoleTextStore . GitTagging ) ;
3747 SuccessOrFailure gitTagResult = await GitHelpers . TryCreateGitTag ( updatedVersion ) ;
3848 if ( gitTagResult is { IsFailure : true , AsFailure . Value : var errorTagging } ) {
39- Console . WriteLine ( errorTagging ) ;
49+ Console . WriteLine ( ConsoleTextStore . CommandEndFailure ( errorTagging ) ) ;
4050 return ;
4151 }
4252
43- Console . WriteLine ( $ "Version { updatedVersion } committed and tagged successfully." ) ;
53+ Console . WriteLine ( ConsoleTextStore . TagSuccessful ( updatedVersion ) ) ;
4454
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 ;
5258 }
5359
54- Console . WriteLine ( "Pushing to origin ..." ) ;
60+ Console . WriteLine ( ConsoleTextStore . GitPushingToRemote ) ;
5561 SuccessOrFailure pushResult = await GitHelpers . TryPushToOrigin ( ) ;
5662 if ( pushResult is { IsFailure : true , AsFailure . Value : var errorPushing } ) {
57- Console . WriteLine ( errorPushing ) ;
63+ Console . WriteLine ( ConsoleTextStore . CommandEndFailure ( errorPushing ) ) ;
5864 return ;
5965 }
6066
6167 SuccessOrFailure pushTagsResult = await GitHelpers . TryPushTagsToOrigin ( ) ;
6268 if ( pushTagsResult is { IsFailure : true , AsFailure . Value : var errorPushingTags } ) {
63- Console . WriteLine ( errorPushingTags ) ;
69+ Console . WriteLine ( ConsoleTextStore . CommandEndFailure ( errorPushingTags ) ) ;
6470 return ;
6571 }
6672
67- Console . WriteLine ( "Pushed to origin successfully." ) ;
73+ Console . WriteLine ( ConsoleTextStore . CommandEndSuccess ( ) ) ;
6874 }
6975
7076
@@ -104,7 +110,7 @@ private static async Task<SuccessOrFailure<SemanticVersionDto>> BumpVersion(Vers
104110 }
105111
106112 versionElement . Value = versionDto . ToString ( ) ;
107- Console . WriteLine ( $ "Updated version of package { projectName } to { versionElement . Value } " ) ;
113+ Console . WriteLine ( ConsoleTextStore . UpdatedVersion ( projectName , versionElement . Value ) ) ;
108114 }
109115
110116 return versionDto is not null
0 commit comments