Skip to content

Commit

Permalink
chore: apply automated updates
Browse files Browse the repository at this point in the history
  • Loading branch information
autofix-ci[bot] authored Jan 13, 2025
1 parent b5f5414 commit fc8b9b9
Showing 1 changed file with 16 additions and 9 deletions.
25 changes: 16 additions & 9 deletions examples/prompt.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
Expand All @@ -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));
Expand Down

0 comments on commit fc8b9b9

Please sign in to comment.