Skip to content

Commit 3aa981e

Browse files
committed
fix(taskmaster): improve tmai initialization flow
1 parent ca5ddfd commit 3aa981e

2 files changed

Lines changed: 56 additions & 56 deletions

File tree

src/core/taskmaster/exec.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,15 @@ import { tmaiInitMenu_prompt } from "@/prompt";
1313
const tmai = new TaskMaster();
1414

1515
export async function tmaiInitAsync() {
16-
const choice = await inquirer.prompt(tmaiInitMenu_prompt);
16+
const choice = await inquirer.prompt(tmaiInitMenu_prompt);
1717

18-
if (choice.tmInitMenu === "tmai-install") {
19-
await tmai.installAsync();
20-
} else if (choice.tmInitMenu === "tmai-init") {
21-
await tmai.initAsync();
22-
} else if (choice.tmInitMenu === "tmai-config") {
23-
await tmai.configAsync();
24-
}
18+
if (choice.tmInitMenu === "tmai-install") {
19+
await tmai.installAsync();
20+
} else if (choice.tmInitMenu === "tmai-init") {
21+
await tmai.initAsync();
22+
} else if (choice.tmInitMenu === "tmai-config") {
23+
await tmai.configAsync();
24+
}
2525

26-
await restartAsync();
26+
await restartAsync();
2727
}

src/index.ts

Lines changed: 47 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -21,58 +21,58 @@ import pkg from "../package.json";
2121
* @description Entry point of the CLI
2222
*/
2323
export async function taskmasterCLI(): Promise<void> {
24-
// show banner
25-
const banner = await bannerRendererAsync(
26-
"taskmaster-cli",
27-
`${pkg.description}`
28-
);
29-
console.log(`${banner}\n`);
24+
// show banner
25+
const banner = await bannerRendererAsync(
26+
"taskmaster-cli",
27+
`${pkg.description}`,
28+
);
29+
console.log(`${banner}\n`);
3030

31-
// start menu
32-
const choice = await inquirer.prompt(mainMenu_prompt);
31+
// start menu
32+
const choice = await inquirer.prompt(mainMenu_prompt);
3333

34-
// switch menu
35-
switch (choice.mainMenu) {
36-
case "tmai-init":
37-
await tmaiInitAsync();
38-
break;
39-
case "tmai-gen":
40-
console.log("TM operations for generation ...");
41-
break;
42-
case "tmai-manage":
43-
console.log("TM operations for management ...");
44-
break;
45-
case "tmai-deps":
46-
console.log("TM operations for dependencies ...");
47-
break;
48-
case "tmai-analysis":
49-
console.log("TM operations for analysis ...");
50-
break;
51-
case "tmai-docs":
52-
console.log("TM operations for documentation ...");
53-
break;
54-
case "tmai-dev":
55-
console.log("TM operations for development ...");
56-
break;
57-
case "exit":
58-
exitCLI();
59-
break;
60-
default:
61-
taskmasterCLI();
62-
break;
63-
}
34+
// switch menu
35+
switch (choice.mainMenu) {
36+
case "tmai-init":
37+
await tmaiInitAsync();
38+
break;
39+
case "tmai-gen":
40+
console.log("TM operations for generation ...");
41+
break;
42+
case "tmai-manage":
43+
console.log("TM operations for management ...");
44+
break;
45+
case "tmai-deps":
46+
console.log("TM operations for dependencies ...");
47+
break;
48+
case "tmai-analysis":
49+
console.log("TM operations for analysis ...");
50+
break;
51+
case "tmai-docs":
52+
console.log("TM operations for documentation ...");
53+
break;
54+
case "tmai-dev":
55+
console.log("TM operations for development ...");
56+
break;
57+
case "exit":
58+
exitCLI();
59+
break;
60+
default:
61+
taskmasterCLI();
62+
break;
63+
}
6464
}
6565

6666
function args(): void {
67-
const packageVersion = pkg.version;
68-
const program = new Command();
69-
program.option("-v, --version", "show CLI version");
70-
program.parse(process.argv);
71-
if (program.opts().version) {
72-
console.log(`version ${packageVersion}`);
73-
} else {
74-
taskmasterCLI();
75-
}
67+
const packageVersion = pkg.version;
68+
const program = new Command();
69+
program.option("-v, --version", "show CLI version");
70+
program.parse(process.argv);
71+
if (program.opts().version) {
72+
console.log(`version ${packageVersion}`);
73+
} else {
74+
taskmasterCLI();
75+
}
7676
}
7777

7878
args();

0 commit comments

Comments
 (0)