Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid asking user to use template if templateName exists #77

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

troym9731
Copy link

Even when specifying a templateName in a config file, the "Do you wanna choose a template" prompt comes up.

It seems like now that the config object is a combination of both the args and the config passed by the user, it should be fine to get rid of this prompt and just check for the existence of config.t, config.template, or config.templateName.

@@ -32,22 +32,11 @@ async function getTemplatesPath(templateName = null) {
}

async function getTemplateOption() {
const templateArg = args.t || args.template
const templateArg = config.t || config.template || config.templateName
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your catch!
This line is ok ;)

src/index.js Outdated
if (templateArg) {
return getTemplatesPath(templateArg)
}

const { template } = await inquirer.prompt([
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These lines of code need in case the template is not specified in the config.
The behavior is expected because one of the features of the tool is to use templates from the community.
screen shot 2018-11-20 at 23 39 20

Could you please commit again with these lines of code?
Thank you so much man for your contribution 👍

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, no problem!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants