MCPcopy Create free account
hub / github.com/PaperElectron/Sundry / finishPrompt

Function finishPrompt

cli/interactive.js:150–175  ·  view source on GitHub ↗
(fn)

Source from the content-addressed store, hash-verified

148}
149
150function finishPrompt(fn) {
151 return Prompt({
152 type: 'list',
153 name: 'error',
154 message: 'Go back, Main Menu or exit?',
155 choices: [
156 {name: chalk.green('Back'), value: 'back'},
157 {name: chalk.yellow('Main'), value: 'main'},
158 {name: chalk.red('Exit'), value: 'exit'}
159 ]
160 }).then(function(action){
161 switch(action){
162 case 'back':
163 process.stdout.write('\033c');
164 return fn();
165 break;
166 case 'main':
167 process.stdout.write('\033c');
168 return mainPrompt();
169 break;
170 case 'exit':
171 process.stdout.write('\033c');
172 return process.exit(0);
173 }
174 })
175}
176
177function errorPrompt() {
178 return Prompt({

Callers

nothing calls this directly

Calls 2

PromptFunction · 0.85
mainPromptFunction · 0.85

Tested by

no test coverage detected