-
Notifications
You must be signed in to change notification settings - Fork 0
/
cli.js
27 lines (24 loc) · 848 Bytes
/
cli.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
import inquirer from "inquirer";
import { main } from "./src/index.js";
/**
* Starts the CLI and prompts the user for input.
*/
async function startCLI() {
try {
// Using inquirer to prompt the user for the repository path
const answers = await inquirer.prompt([
{
type: "input", // Input type is a simple text input
name: "repoPath", // The key to reference the answer
message: "Enter the absolute path to the repository:", // The prompt message displayed to the user
},
// Additional questions can be added here if needed
]);
// Calling main process with the path provided by the user
main(answers.repoPath);
} catch (error) {
// Error handling in case the prompt fails or the main function throws an error
console.error(`Error: ${error.message}`);
}
}
startCLI();