-
Notifications
You must be signed in to change notification settings - Fork 73
/
Copy pathbump-version.js
36 lines (30 loc) · 1.03 KB
/
bump-version.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
30
31
32
33
34
35
36
const path = require('path');
const { spawn } = require('child_process');
const { templates } = require('./utils');
init();
async function init() {
for (let i = 0; i < templates.length; i++) {
const { name, publishable } = templates[i];
const repoPath = path.resolve(name);
if (publishable) {
await new Promise((resolve) => {
const child = spawn(`cd ${repoPath} && yarn version --patch`, {
shell: true
});
child.stdout.on("data", function (data) {
console.log(`${data}`);
});
child.stderr.on("data", data => {
console.log(`stderr: ${data} `);
});
child.on("error", error => {
console.log(`error: ${error.message}`);
});
child.on("close", () => {
console.log('\x1b[32m%s\x1b[0m',);
resolve();
});
})
}
};
}