Skip to content

Commit 268ab33

Browse files
committed
Repo: Update both version fields in package-lock.json
`package-lock.json` versions 2 & 3 keep `version` in two fields - a top-level `version` one and a deep `packages[ "" ].version` one. Update both.
1 parent 9b846b7 commit 268ab33

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

lib/repo.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,9 @@ Release.define( {
149149
console.log( "Updating " + fileName + "..." );
150150
var json = Release._readJSON( fileName );
151151
json.version = version;
152+
if ( json?.packages[ "" ]?.version ) {
153+
json.packages[ "" ].version = version;
154+
}
152155
Release._writeJSON( fileName, json );
153156
},
154157

0 commit comments

Comments
 (0)