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

Reload config data on file change #1307

Closed
IsmaelMartinez opened this issue Jun 21, 2024 · 1 comment · Fixed by #1325
Closed

Reload config data on file change #1307

IsmaelMartinez opened this issue Jun 21, 2024 · 1 comment · Fixed by #1325

Comments

@IsmaelMartinez
Copy link
Owner

Is your feature request related to a problem? Please describe.
When the yargs config file is changed, a restart of the app is required to pick up the new values

Describe the solution you'd like
I would like for the configuration to "watch" the file and apply any changes in it.

Unfortunately this is not natively supported in yargs (yargs/yargs#585 (comment)), but we should be able to use https://github.com/paulmillr/chokidar to watch the file and re-load the config as stated in the yargs comment.

Once this is implemented, leave a note into the yargs with the example, so others to benefit in the future.

Describe alternatives you've considered
Adding some command line arguments.

Additional context
This could provide the ability of people changing arguments by modifying the config file. The config file is just a json file (like for example using jq '.foo.bar = "new value"' file.json (see https://stackoverflow.com/questions/31034746/how-do-i-update-a-single-value-in-a-json-document-using-jq)

This comes from issue #948 and #1081

@IsmaelMartinez
Copy link
Owner Author

Ok, this is not implemented but it would restart the whole app. This is because currently there is a lot of configuration that needs to be set at the beginning of the app. We might be able to refactor into 'live' and 'start-up' configuration at a later stage, but this is good enough for just now.

Notice that the some UI settings would trigger an app restart if this functionality is on.
image

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 a pull request may close this issue.

1 participant