MCPcopy Create free account
hub / github.com/sourcebot-dev/sourcebot / confirmAction

Function confirmAction

packages/db/tools/utils.ts:3–9  ·  view source on GitHub ↗
(message: string = "Are you sure you want to proceed? [N/y]")

Source from the content-addressed store, hash-verified

1import readline from 'readline-sync';
2
3export const confirmAction = (message: string = "Are you sure you want to proceed? [N/y]") => {
4 const response = readline.question(message).toLowerCase();
5 if (response !== 'y') {
6 console.log("Aborted.");
7 process.exit(0);
8 }
9}
10
11export const abort = () => {
12 console.log("Aborted.");

Calls

no outgoing calls

Tested by

no test coverage detected