diff --git a/examples/prompt.mjs b/examples/prompt.mjs index 59a3391..dda5447 100755 --- a/examples/prompt.mjs +++ b/examples/prompt.mjs @@ -5,17 +5,21 @@ import { consola } from "../dist/index.mjs"; const name = await consola.prompt("What is your name?", { placeholder: "Not sure", initial: "java", - cancel: 'undefined' + cancel: "undefined", }); -if (!name) { process.exit(1) } +if (!name) { + process.exit(1); +} const confirmed = await consola.prompt("Do you want to continue?", { type: "confirm", - cancel: 'undefined' + cancel: "undefined", }); -if (!confirmed) { process.exit(1) } +if (!confirmed) { + process.exit(1); +} const projectType = await consola.prompt("Pick a project type.", { type: "select", @@ -24,11 +28,13 @@ const projectType = await consola.prompt("Pick a project type.", { "TypeScript", { label: "CoffeeScript", value: "CoffeeScript", hint: "oh no" }, ], - cancel: 'undefined', + cancel: "undefined", initial: "TypeScript", }); -if (!projectType) { process.exit(1) } +if (!projectType) { + process.exit(1); +} const tools = await consola.prompt("Select additional tools.", { type: "multiselect", @@ -38,12 +44,13 @@ const tools = await consola.prompt("Select additional tools.", { { value: "prettier", label: "Prettier" }, { value: "gh-action", label: "GitHub Action" }, ], - cancel: 'undefined', + cancel: "undefined", initial: ["eslint", "prettier"], }); -if (!tools) { process.exit(1) } - +if (!tools) { + process.exit(1); +} consola.start("Creating project..."); await new Promise((resolve) => setTimeout(resolve, 1000));