From a3fac25ff56972791ca6c8c2825f81bd8c525d60 Mon Sep 17 00:00:00 2001 From: Tristan Date: Sat, 19 Feb 2022 10:35:04 -0500 Subject: [PATCH] Use new prompt system --- brand.ts | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/brand.ts b/brand.ts index 7a9a34c..7909601 100644 --- a/brand.ts +++ b/brand.ts @@ -1,12 +1,28 @@ import { dirname } from "https://deno.land/std@0.126.0/path/mod.ts"; import { ensureFile } from "https://deno.land/std@0.126.0/fs/mod.ts"; +import { prompt, Input, Number, Confirm, Checkbox } from "https://deno.land/x/cliffy/prompt/mod.ts"; const directoryName = dirname(new URL('', import.meta.url).pathname).match(/\w+(?!\/)$/) -const projectName = prompt(`Enter project name (${directoryName}):`) || directoryName -const preferredMainClass = prompt(`Enter preferred class name (${projectName}):`) || projectName -const packageName = prompt(`Enter package name (${projectName.toLowerCase()}):`) || projectName.toLowerCase() -const description = prompt(`Enter description:`) +const result = await prompt([{ + name: "projectName", + message: "Enter the project name.", + type: Input, +}, { + name: "preferredMainClass", + message: "Enter the preferred class name.", + type: Input, +}, { + name: "packageName", + message: "Enter the preferred package name.", + type: Input +}, { + name: "description", + message: "Enter project description.", + type: Input +}]); + +const { projectName, preferredMainClass, packageName, description } = result const paths = { properties: "./gradle.properties",