-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.ts
39 lines (32 loc) · 1.06 KB
/
index.ts
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
#!/usr/bin/env node
import { questions, args, logging } from './src/apis/index.js'
;(async () => {
const commandArgs = args.parseArgs(process.argv).parseSync()
const isHappy = await questions.areYouHappy()
await logging.showSpinner({ text: 'Starting process ...', color: 'blue' })
if (commandArgs.debug) {
await logging.showMessage({
text: 'Showing a more detailed log',
color: 'yellow',
})
await logging.showMessage({
text: isHappy ? 'You are happy!' : 'You are not happy!',
color: 'yellow',
})
}
if (isHappy) {
await logging.showMessage({
text: "If you are happy, I'm happy too!",
color: 'green',
clear: true,
})
} else {
await logging.showMessage({
text: 'Sorry to hear that!',
color: 'red',
clear: true,
})
}
await logging.showSpinner({ text: 'Finishing process...', color: 'green' })
logging.stopSpinner()
})()