Skip to content

Commit 1e3b486

Browse files
committed
feat: mainloop terminal
1 parent 566a98d commit 1e3b486

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/index.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,15 @@ const STOP_TERM = ":q";
77

88
const terminalController = new TerminalController();
99
terminalController.initializeTerminal(database, DEFAULT_LANG);
10+
11+
async function mainLoop() {
12+
try {
13+
const answer = await terminalController.question();
14+
if (answer === STOP_TERM) {
15+
terminalController.closeTerminal();
16+
console.log("processo finalizado");
17+
return;
18+
}
19+
const person = Person.generateInstanceFromString(answer);
20+
} catch (error) {}
21+
}

0 commit comments

Comments
 (0)