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

@ -133,7 +133,9 @@ class CommandProtocol(protocol.ProcessProtocol):
cmd_args = [command] + args
if "env" not in kwargs:
# we pass parent environment by default
kwargs["env"] = None
# FIXME: `None` doesn't seem to work, despite what documentation says, to be
# checked and reported upstream if confirmed.
kwargs["env"] = os.environ
reactor.spawnProcess(prot,
command,
cmd_args,