Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 3 additions & 16 deletions lib/repo.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ var fs = require( "fs" ),
module.exports = function( Release ) {

Release.define( {
_jsonFiles: [ "package.json", "package-lock.json", "bower.json" ],
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought I first need to remove version from UI's bower.json but I do not - the version field was only added on tagged releases, on main it's not there.

_jsonFiles: [ "package.json", "package-lock.json" ],

_cloneRepo: function() {
var releaseDependencies, projectRelease;
Expand Down Expand Up @@ -142,20 +142,8 @@ Release.define( {
Release._writeJSON( "package.json", json );
},

_versionJSON: function( fileName, version ) {
if ( !fs.existsSync( Release.dir.repo + "/" + fileName ) ) {
return;
}
console.log( "Updating " + fileName + "..." );
var json = Release._readJSON( fileName );
json.version = version;
Release._writeJSON( fileName, json );
},

_setVersion: function( version ) {
Release._jsonFiles.forEach( function( file ) {
Release._versionJSON( file, version );
} );
Release.exec( "npm version " + version + " --no-git-tag-version" );
},

_getVersions: function() {
Expand Down Expand Up @@ -272,8 +260,7 @@ Release.define( {
"Error checking out " + Release.branch + " branch." );

// Update only canonical version
Release._versionJSON( "package.json", Release.nextVersion );
Release._versionJSON( "package-lock.json", Release.nextVersion );
Release._setVersion( Release.nextVersion );

console.log( "Committing version update..." );
Release.exec( "git commit -am \"Build: Updating the " + Release.branch +
Expand Down
2 changes: 2 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.