Skip to content
This repository has been archived by the owner on Sep 2, 2024. It is now read-only.

Commit

Permalink
Use new prompt system
Browse files Browse the repository at this point in the history
  • Loading branch information
LeoDog896 committed Feb 19, 2022
1 parent 33c8242 commit a3fac25
Showing 1 changed file with 20 additions and 4 deletions.
24 changes: 20 additions & 4 deletions brand.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,28 @@
import { dirname } from "https://deno.land/[email protected]/path/mod.ts";
import { ensureFile } from "https://deno.land/[email protected]/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",
Expand Down

0 comments on commit a3fac25

Please sign in to comment.