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

Allow setting option init without default value #114

Merged
merged 1 commit into from
Nov 28, 2017
Merged

Allow setting option init without default value #114

merged 1 commit into from
Nov 28, 2017

Conversation

aapokiiso
Copy link
Contributor

The init method didn't run when configuring an option without a default value, like this:

args
    .options([
        {
            name: 'theme',
            description: 'Build a specific theme in app/design',
            init: val => Array.isArray(val) ? val : [ val ], // Didn't run
        },
        {
            name: 'module',
            description: 'Build a specific module in app/code/local or vendor/',
            defaultValue: [],
            init: val => Array.isArray(val) ? val : [ val ], // Default value defined, runs correctly
        },
        ...
    ]);

I changed the logic slightly so that a default value is not required if you define an init method.

@ntwcklng
Copy link
Collaborator

LGTM, thanks!

@ntwcklng ntwcklng merged commit 3168f06 into leo:master Nov 28, 2017
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