forked from Qortal/qortal-ui
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathupdate-package-json.js
29 lines (22 loc) · 1.07 KB
/
update-package-json.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
const fs = require('fs')
const uiPackageFilePath = 'package.json';
const uiPackageFile = fs.readFileSync(uiPackageFilePath, 'utf8');
const uiPackage = JSON.parse(uiPackageFile);
const corePackageFilePath = './qortal-ui-core/package.json';
const corePackageFile = fs.readFileSync(corePackageFilePath, 'utf8');
const corePackage = JSON.parse(corePackageFile);
const cryptoPackageFilePath = './qortal-ui-crypto/package.json';
const cryptoPackageFile = fs.readFileSync(cryptoPackageFilePath, 'utf8');
const cryptoPackage = JSON.parse(cryptoPackageFile);
const pluginsPackageFilePath = './qortal-ui-plugins/package.json';
const pluginsPackageFile = fs.readFileSync(pluginsPackageFilePath, 'utf8');
const pluginsPackage = JSON.parse(pluginsPackageFile);
uiPackage.dependencies = {
...uiPackage.dependencies,
"qortal-ui-core": corePackage.version,
"qortal-ui-crypto": cryptoPackage.version,
"qortal-ui-plugins": pluginsPackage.version
}
console.log(uiPackage.dependencies);
fs.writeFileSync(uiPackageFilePath, JSON.stringify(uiPackage, null, 2));
console.log('Package.Json updated');