-
Notifications
You must be signed in to change notification settings - Fork 7
/
cli.mjs
executable file
·31 lines (27 loc) · 766 Bytes
/
cli.mjs
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
import { cancel, isCancel, select } from '@clack/prompts'
import { createBlog } from './.github/cli/create-blog.mjs'
import { sendEmail } from './.github/cli/send-email.mjs'
import { updateSponsorships } from './.github/cli/update-sponsorships.mjs'
const intention = await select({
message: 'What do you want to do?',
options: [
{ label: 'Create a blog post', value: 'blog' },
{ label: 'Send an email', value: 'email' },
{ label: 'Update sponsorships', value: 'sponsorship' },
],
})
if (isCancel(intention)) {
cancel('Operation cancelled')
process.exit(0)
}
switch (intention) {
case 'email':
await sendEmail()
break
case 'blog':
await createBlog()
break
case 'sponsorship':
await updateSponsorships()
break
}