gruntjs / gruntjs/grunt-init

Values from defaults.json only applied to build-in prompts

Open
#48 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
195
Forks
57
PR merge metrics
No merged PRs in 30d

Description

## Background

As i create a custom prompt in my template.js like:

```
{
name: 'langcode',
message: 'The language of the default index.html',
default: 'en',
warning: 'It must be an 2 character language code.'
}
```

It will always get the value "en" as the default. Even though I added "langcode to my _defaults.json".
## Expected behaviour

It should use the value from the defaults.json as its default value if the key "langcode" is present in defaults.json
## Extra info
- same thing happends if I make the defaults a `function` instead of a string.
- the defaults.json is loaded because the values are used in different prompts in the same `template.js`

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.