diff options
author | Samy Pessé <samypesse@gmail.com> | 2017-01-13 19:03:48 +0100 |
---|---|---|
committer | Samy Pessé <samypesse@gmail.com> | 2017-01-13 19:03:48 +0100 |
commit | 803d6218a71799c635f3a28089ae5e1ddcd7ee07 (patch) | |
tree | 4bf83f7c99450d01a76d405ceee16fa0d5b2312c /scripts | |
parent | 7128db842a9dd1b68ba08d5e527546518c8618a8 (diff) | |
download | gitbook-803d6218a71799c635f3a28089ae5e1ddcd7ee07.zip gitbook-803d6218a71799c635f3a28089ae5e1ddcd7ee07.tar.gz gitbook-803d6218a71799c635f3a28089ae5e1ddcd7ee07.tar.bz2 |
Remove bump script from bootstrapping
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/bump.js | 42 |
1 files changed, 0 insertions, 42 deletions
diff --git a/scripts/bump.js b/scripts/bump.js deleted file mode 100755 index 2a4d592..0000000 --- a/scripts/bump.js +++ /dev/null @@ -1,42 +0,0 @@ -#! /usr/bin/env node - -const fs = require('fs'); -const path = require('path'); - -const lernaConfig = require('../lerna.json'); - -// List all the packages -const PACKAGES_DIR = path.resolve(__dirname, '../packages'); -const packages = fs.readdirSync(PACKAGES_DIR); - -function updateDependencies(dependencies) { - if (!dependencies) { - return; - } - - Object.keys(dependencies).map((key) => { - if (!packages.includes(key)) { - return; - } - - dependencies[key] = lernaConfig.version; - }); -} - -packages.forEach((name) => { - // Avoid .DS_Store - if (name[0] === '.') { - return; - } - - const pkgPath = path.resolve(PACKAGES_DIR, name, 'package.json'); - const pkg = require(pkgPath); - - pkg.version = lernaConfig.version; - updateDependencies(pkg.dependencies); - updateDependencies(pkg.devDependencies); - - const json = JSON.stringify(pkg, null, 2); - - fs.writeFileSync(pkgPath, `${json}\n`, 'utf-8'); -}); |