From 81f3b493e49415c3b2d7ddde82da4bd34d85dcb7 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Sat, 5 Dec 2020 21:06:23 +0100 Subject: [PATCH] Also copy the script env --- src/yunohost/hook.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/yunohost/hook.py b/src/yunohost/hook.py index af9897851..1758a1167 100644 --- a/src/yunohost/hook.py +++ b/src/yunohost/hook.py @@ -397,9 +397,12 @@ def _hook_exec_bash(path, args, chdir, env, return_format, loggers): logger.debug("Executing command '%s'" % cmd) + _env = os.environ.copy() + _env.update(env) + returncode = call_async_output( cmd, loggers, shell=True, cwd=chdir, - stdinfo=stdinfo, env=env + stdinfo=stdinfo, env=_env ) raw_content = None