-
Notifications
You must be signed in to change notification settings - Fork 0
/
publish.js
45 lines (39 loc) · 1.12 KB
/
publish.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
37
38
39
40
41
42
43
44
45
/* eslint-disable no-console */
const inquirer = require('inquirer');
const spawn = require('./packages/koot-cli-kit/spawn');
const run = async () => {
console.log('\n');
console.log(`\x1b[43m \x1b[0m\x1b[33m koot-kit publish...\x1b[0m`);
console.log('');
const { tag = false } = await inquirer.prompt({
type: 'list',
name: 'tag',
message: 'Select tag for NPM',
choices: [
{
name: 'Please select a tag',
value: false,
},
{
name: 'No tag (none)',
value: '',
},
'next',
],
default: 0,
});
console.log('');
if (tag === false) {
console.log('\n');
console.log(
`\x1b[43m \x1b[0m\x1b[31m Please select a tag type. Abort!\x1b[0m`
);
console.log('');
return;
}
await spawn(`lerna publish` + (tag ? ` --dist-tag ${tag}` : ''));
console.log('\n');
console.log(`\x1b[42m \x1b[0m\x1b[32m Publish complete\x1b[0m`);
console.log('');
};
run().catch(async (e) => console.error(e));