From 527c45fbf5c7a47ef30cd689208843b892f54033 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 e41aadbd..45859cc4 100644 --- a/src/index.js +++ b/src/index.js @@ -112,6 +112,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))