@@ -94,34 +94,34 @@ export class VersionAction extends BaseRushAction {
9494 }
9595
9696 protected run ( ) : Promise < void > {
97- PolicyValidator . validatePolicy ( this . rushConfiguration , this . _bypassPolicy . value ) ;
98- const userEmail : string = Git . getGitEmail ( this . rushConfiguration ) ;
97+ return Promise . resolve ( ) . then ( ( ) => {
98+ PolicyValidator . validatePolicy ( this . rushConfiguration , this . _bypassPolicy . value ) ;
99+ const userEmail : string = Git . getGitEmail ( this . rushConfiguration ) ;
99100
100- this . _validateInput ( ) ;
101+ this . _validateInput ( ) ;
101102
102- this . _versionManager = new VersionManager ( this . rushConfiguration , userEmail ) ;
103+ this . _versionManager = new VersionManager ( this . rushConfiguration , userEmail ) ;
103104
104- if ( this . _ensureVersionPolicy . value ) {
105- this . _overwritePolicyVersionIfNeeded ( ) ;
106- const tempBranch : string = 'version/ensure-' + new Date ( ) . getTime ( ) ;
107- this . _versionManager . ensure ( this . _versionPolicy . value , true ,
108- ! ! this . _overrideVersion . value || ! ! this . _prereleaseIdentifier . value ) ;
105+ if ( this . _ensureVersionPolicy . value ) {
106+ this . _overwritePolicyVersionIfNeeded ( ) ;
107+ const tempBranch : string = 'version/ensure-' + new Date ( ) . getTime ( ) ;
108+ this . _versionManager . ensure ( this . _versionPolicy . value , true ,
109+ ! ! this . _overrideVersion . value || ! ! this . _prereleaseIdentifier . value ) ;
109110
110- const updatedPackages : Map < string , IPackageJson > = this . _versionManager . updatedProjects ;
111- if ( updatedPackages . size > 0 ) {
112- console . log ( `${ updatedPackages . size } packages are getting updated.` ) ;
111+ const updatedPackages : Map < string , IPackageJson > = this . _versionManager . updatedProjects ;
112+ if ( updatedPackages . size > 0 ) {
113+ console . log ( `${ updatedPackages . size } packages are getting updated.` ) ;
114+ this . _gitProcess ( tempBranch ) ;
115+ }
116+ } else if ( this . _bumpVersion . value ) {
117+ const tempBranch : string = 'version/bump-' + new Date ( ) . getTime ( ) ;
118+ this . _versionManager . bump ( this . _versionPolicy . value ,
119+ this . _overwriteBump . value ? BumpType [ this . _overwriteBump . value ] : undefined ,
120+ this . _prereleaseIdentifier . value ,
121+ true ) ;
113122 this . _gitProcess ( tempBranch ) ;
114123 }
115- } else if ( this . _bumpVersion . value ) {
116- const tempBranch : string = 'version/bump-' + new Date ( ) . getTime ( ) ;
117- this . _versionManager . bump ( this . _versionPolicy . value ,
118- this . _overwriteBump . value ? BumpType [ this . _overwriteBump . value ] : undefined ,
119- this . _prereleaseIdentifier . value ,
120- true ) ;
121- this . _gitProcess ( tempBranch ) ;
122- }
123-
124- return Promise . resolve ( ) ;
124+ } ) ;
125125 }
126126
127127 private _overwritePolicyVersionIfNeeded ( ) : void {
0 commit comments