diff --git a/build/release.js b/build/release.js index 92242abe..194fbe6c 100644 --- a/build/release.js +++ b/build/release.js @@ -147,8 +147,7 @@ function tagReleaseVersion( next ) { function updateVersions( next ) { updateSourceVersion( releaseVersion ); updateReadmeVersion( releaseVersion ); - updatePackageVersion( releaseVersion ); - next(); + updatePackageVersion( releaseVersion, undefined, next ); } async function buildRelease( next ) { @@ -211,9 +210,12 @@ async function publishToNPM( next ) { function setNextVersion( next ) { updateSourceVersion( nextVersion ); - updatePackageVersion( nextVersion, "main" ); - git( [ "commit", "-a", "--no-verify", "-m", "Updating the source version to " + nextVersion ], - next ); + updatePackageVersion( nextVersion, "main", function() { + git( + [ "commit", "-a", "--no-verify", + "-m", "Updating the source version to " + nextVersion ], + next ); + } ); } function pushToRemote( next ) { @@ -244,12 +246,22 @@ function steps() { } )(); } -function updatePackageVersion( ver, blobVer ) { +function updatePackageVersion( ver, blobVer, next ) { status( "Updating " + packageFile + " version to " + ver ); blobVer = blobVer || ver; - pkg.version = ver; pkg.author.url = setBlobVersion( pkg.author.url, blobVer ); writeJsonSync( packageFile, pkg ); + child.execFile( "npm", [ + "version", + ver, + "--no-git-tag-version" + ], function( error, stdout ) { + if ( error ) { + throw error; + } + console.log( stdout ); + next(); + } ); } function updateSourceVersion( ver ) {