From a7270bb84c13e803ca851e9426c2cef5071a583b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20B=C3=B6nnemann?= Date: Mon, 24 Aug 2015 15:35:45 +0200 Subject: [PATCH] fix: write version to shrinkwrap if existent Closes #11 --- src/index.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/index.js b/src/index.js index 5827a33c..82028f15 100644 --- a/src/index.js +++ b/src/index.js @@ -115,6 +115,15 @@ npmconf.load({}, (err, conf) => { process.exit(1) } + try { + let shrinkwrap = JSON.parse(readFileSync('./npm-shrinkwrap.json')) + shrinkwrap.version = release.version + writeFileSync('./npm-shrinkwrap.json', JSON.stringify(shrinkwrap, null, 2)) + log.verbose('pre', `Wrote version ${release.version} to npm-shrinkwrap.json.`) + } catch (e) { + log.silly('pre', `Couldn't find npm-shrinkwrap.json.`) + } + writeFileSync('./package.json', JSON.stringify(_.assign(pkg, { version: release.version }), null, 2))