Skip to content

Commit b68fe2e

Browse files
committed
fix: fix deps locks commit
1 parent 34b6a46 commit b68fe2e

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

lib/package.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -969,8 +969,13 @@ export default class Package {
969969

970970
// working tree is dirty
971971
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" );
972+
for ( const lockFile of [ "package-lock.json", "npm-shrinkwrap.json" ] ) {
973+
const lockFilePath = this.rootSlug
974+
? this.rootSlug + "/" + lockFile
975+
: lockFile;
976+
977+
if ( res.data.files[ lockFilePath ] ) commitFiles.push( lockFile );
978+
}
974979
}
975980

976981
// dependencies locks was not updated

0 commit comments

Comments
 (0)