@sprucelabs/spruce-cli
Version:
Command line interface for building Spruce skills.
49 lines • 1.78 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const onboarding_short_script_1 = require("./onboarding.short.script");
const script = [
'Hold on! ✋',
"I don't think you're supposed to be here!",
'I was really expecting you to run:',
(player) => {
(0, onboarding_short_script_1.renderCommand)(player.ui, player.onboardingStore.getStage());
},
'But you are in a completely different place.',
async (player) => {
const stage = player.onboardingStore.getStage();
const answer = await player.ui.prompt({
type: 'select',
label: 'What should we do?',
options: {
choices: [
{
label: 'Continue forward',
value: 'letMePass',
},
{
label: 'Stop onboarding',
value: 'disable',
},
{
label: `Execute \`${stage}\``,
value: 'executeCommand',
},
],
},
});
switch (answer) {
case 'disable':
player.onboardingStore.reset();
player.ui.renderLine('');
player.ui.renderLine(`Ok, I've disabled onboarding for now. Hope to see you again soon!`);
player.ui.renderLine('');
case 'letMePass':
await player.ui.waitForEnter('As you were!');
break;
default:
throw new Error('Coming soon! For now you have to manually run!');
}
},
];
exports.default = script;
//# sourceMappingURL=wrongCommand.script.js.map