MCPcopy Create free account
hub / github.com/Acode-Foundation/Acode / handleAnswer

Function handleAnswer

utils/storage_manager.mjs:82–98  ·  view source on GitHub ↗
(answer)

Source from the content-addressed store, hash-verified

80}
81
82async function handleAnswer(answer) {
83 answer = answer.trim().toLowerCase();
84 if (answer === 'yes' || answer === 'y') {
85 if(await addPermission()){
86 updatePlugin()
87 }
88
89 } else if (answer === 'no' || answer === 'n') {
90 if(await removePermission()){
91 updatePlugin()
92 }
93
94 } else {
95 console.error("Invalid input. Please type 'yes' or 'no'.");
96 process.exit(1);
97 }
98}
99
100function prompt() {
101 const rl = readline.createInterface({ input, output });

Callers 2

promptFunction · 0.85

Calls 5

addPermissionFunction · 0.85
updatePluginFunction · 0.85
removePermissionFunction · 0.85
exitMethod · 0.80
errorMethod · 0.45

Tested by

no test coverage detected