mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
[enh] allow to uses in action cwd
This commit is contained in:
parent
fbaac17870
commit
3facf89c7e
1 changed files with 6 additions and 1 deletions
|
@ -1412,11 +1412,16 @@ def app_action_run(app_id, action, args=None):
|
|||
|
||||
os.chmod(path, 700)
|
||||
|
||||
if action_declaration.get("cwd"):
|
||||
cwd = action_declaration["cwd"].replace("$app_id", app_id)
|
||||
else:
|
||||
cwd = "/etc/yunohost/apps/" + app_id
|
||||
|
||||
retcode = hook_exec(
|
||||
path,
|
||||
args=args_list,
|
||||
env=env_dict,
|
||||
chdir=action_declaration.get("cwd", "/etc/yunohost/apps/" + app_id),
|
||||
chdir=cwd,
|
||||
user=action_declaration.get("user", "root"),
|
||||
)
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue