Files
twenty/cli/src/install/demo/index.ts
Félix Malfait e8f1146ae1 CLI to install project (#164)
* CLI to install project

* CLI fixes

* Update README.md

* Cleanup gitignore
2023-06-01 09:19:49 +02:00

28 lines
749 B
TypeScript

import prompts, { PromptObject } from 'prompts';
import { askDemoCloudQuestions } from './cloud.js';
import { askDemoDockerQuestions } from './docker.js';
export const demoQuestions: PromptObject<string>[] = [
{
type: 'select',
name: 'demo_type',
message: 'How do you want to try the app?',
choices: [
{ title: 'Cloud demo', value: 'cloud' },
{ title: 'Local docker image', value: 'docker', disabled: true },
],
},
];
export const askDemoQuestions: () => Promise<void> = async () => {
const response = await prompts(demoQuestions);
switch (response.demo_type) {
case 'cloud':
await askDemoCloudQuestions();
break;
case 'docker':
await askDemoDockerQuestions();
break;
}
};