core: add new init_script_path option:

`init_script_path` option can be used in `[DEFAULTS]` to run a script at the end of
backend initialisation. A new `init_pre_script` method is used to wait for backend to
reach this stage (designed to be used mostly by CLI frontend), then the usual `ready_get`
method is finished once the script is finished.
This commit is contained in:
Goffi 2023-12-13 22:00:22 +01:00
commit e14dd9da8b

View file

@ -713,7 +713,9 @@ class LiberviaCli:
)
self.quit(C.EXIT_BRIDGE_ERROR, raise_exc=False)
return
await self.bridge.ready_get()
# we wait on init_pre_script instead of ready_get, so the CLI frontend can be used
# in init script.
await self.bridge.init_pre_script()
self.version = await self.bridge.version_get()
self._bridge_connected()
self.import_plugins()