Skip to content
This repository has been archived by the owner on Oct 20, 2020. It is now read-only.

Default params values are not written into config #4

Open
MaksymZavershynskyi opened this issue Sep 1, 2020 · 0 comments
Open

Default params values are not written into config #4

MaksymZavershynskyi opened this issue Sep 1, 2020 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@MaksymZavershynskyi
Copy link

When user does not specify param value that has a default value (e.g. https://github.com/near/rainbow-bridge-cli/blob/9706e057dae85127901c2591090f16d2071ebff4/index.js#L161), the default value is not written into config.

Apparently, it is a quirk of commander. It does not call a custom argument handler https://github.com/near/rainbow-bridge-lib/blame/master/config/index.js#L46 when argument has default value but user does not override it. Which means that this code here is probably not executed https://github.com/near/rainbow-bridge-lib/blame/master/config/index.js#L66

The workaround would be to pre-populate this.paramValues with default values when command is executed.

Note, populating default params in maybeGetParam will not work because not all params are guaranteed to be accessed by the command.

@MaksymZavershynskyi MaksymZavershynskyi added the bug Something isn't working label Sep 1, 2020
@Kouprin Kouprin mentioned this issue Sep 11, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants