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

Commit

Permalink
Kaustav | #39 | Added prompts for description, version, license and k…
Browse files Browse the repository at this point in the history
…eywords. | TG-39
  • Loading branch information
phoenixTW committed Jul 30, 2019
1 parent f4394b1 commit 820d1ca
Showing 1 changed file with 23 additions and 7 deletions.
30 changes: 23 additions & 7 deletions src/helpers/input.helper.js
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 };

0 comments on commit 820d1ca

Please sign in to comment.