File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -958,23 +958,24 @@ export default class Package {
958958 console . log ( ansi . ok ( " OK " ) ) ;
959959 }
960960
961- // get working tree status
962- res = await this . git . getWorkingTreeStatus ( ) ;
963- if ( ! res . ok ) return res ;
961+ // commit and push
962+ if ( commit ) {
963+
964+ // get working tree status
965+ res = await this . git . getWorkingTreeStatus ( ) ;
966+ if ( ! res . ok ) return res ;
964967
965- const commitFiles = [ ] ;
968+ const commitFiles = [ ] ;
966969
967- // working tree is dirty
968- if ( res . data . isDirty ) {
969- if ( res . data . files [ "package-lock.json" ] ) commitFiles . push ( "package-lock.json" ) ;
970- if ( res . data . files [ "npm-shrinkwrap.json" ] ) commitFiles . push ( "npm-shrinkwrap.json" ) ;
970+ // working tree is dirty
971+ if ( res . data . isDirty ) {
972+ if ( res . data . files [ "package-lock.json" ] ) commitFiles . push ( "package-lock.json" ) ;
973+ if ( res . data . files [ "npm-shrinkwrap.json" ] ) commitFiles . push ( "npm-shrinkwrap.json" ) ;
974+ }
971975
972976 // dependencies locks was not updated
973977 if ( ! commitFiles . length ) return result ( 200 ) ;
974- }
975978
976- // commit and push
977- if ( commit ) {
978979 process . stdout . write ( "Commit and push ... " ) ;
979980
980981 // add changes
You can’t perform that action at this time.
0 commit comments