Add a "config checker file" in plugins
Closed this issue · 3 comments
QuentinCG commented
Hey,
This is a proposal, not an issue:
Since plugin config may be not well done by the user and make the plugin not work properly, it would be great to have a file executed at the startup of Jarvis which checks that the data the user put are valid.
For example, a plugin to send mail could check at jarvis startup that the email and password are valid and warn user if it is not.
A plugin needing a list could check that the variable is really a list, ...
alexylem commented
You can already to this at plugin level, ex:
config.sh
myplugin_username="" # let's say the user forgot to set it
functions.sh
myplugin_checkconfig() {
[ -n "$myplugin_username" ] || jv_error "you must set a username in myplugin config
}
hooks/program_startup
myplugin_checkconfig
QuentinCG commented
Nice!
Sorry for this request then ;)
alexylem commented
Np glad to help 😄