This repository has been archived by the owner on May 25, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Kaustav | #39 | Added prompts for description, version, license and k…
…eywords. | TG-39
- Loading branch information
Showing
1 changed file
with
23 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,30 @@ | ||
const {cli} = require('cli-ux') | ||
const {getAuthorName} = require('./git.helper') | ||
const { cli } = require("cli-ux"); | ||
const { getAuthorName } = require("./git.helper"); | ||
|
||
const AUTHOR_NAME_KEY = 'Author Name' | ||
const AUTHOR_NAME_KEY = "Author Name"; | ||
const DESCRIPTION_KEY = "Description"; | ||
const VERSION_KEY = "Version"; | ||
const LICENSE_KEY = "License"; | ||
const KEYWORDS_KEY = "Keywords"; | ||
|
||
const trimKeyword = keyword => keyword.trim(); | ||
|
||
const processUserInput = async appName => { | ||
const author = await cli.prompt(AUTHOR_NAME_KEY, {default: getAuthorName()}) | ||
const description = await cli.prompt(DESCRIPTION_KEY, { default: "" }); | ||
const author = await cli.prompt(AUTHOR_NAME_KEY, { | ||
default: getAuthorName() | ||
}); | ||
const version = await cli.prompt(VERSION_KEY, { default: "0.0.0" }); | ||
const license = await cli.prompt(LICENSE_KEY, { default: "ISC" }); | ||
const keywords = await cli.prompt(KEYWORDS_KEY, { default: "" }); | ||
return { | ||
name: appName, | ||
description, | ||
author, | ||
} | ||
} | ||
version, | ||
license, | ||
keywords: keywords.split(",").map(trimKeyword) | ||
}; | ||
}; | ||
|
||
module.exports = {processUserInput} | ||
module.exports = { processUserInput }; |