(fn)
| 148 | } |
| 149 | |
| 150 | function 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 | |
| 177 | function errorPrompt() { |
| 178 | return Prompt({ |
nothing calls this directly
no test coverage detected