Skip to content

Commit b4c1236

Browse files
committed
fix: fix dependency updater changes detection
1 parent 5548cff commit b4c1236

1 file changed

Lines changed: 12 additions & 11 deletions

File tree

lib/package.js

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)