From 4b4ce9aef63ba4408fdc87d0e13a6a3b1a3d9220 Mon Sep 17 00:00:00 2001 From: tituspijean Date: Wed, 24 May 2023 23:13:52 +0200 Subject: [PATCH] Default to WorkingDirectory then install_dir for ynh_spawn_app_shell Co-authored-by: Tagada <36127788+Tagadda@users.noreply.github.com> --- helpers/apps | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/helpers/apps b/helpers/apps index fb5ac25b0..feda02f5e 100644 --- a/helpers/apps +++ b/helpers/apps @@ -178,5 +178,12 @@ ynh_spawn_app_shell() { fi # Open the app shell + local env_dir = $(systemctl show $app.service -p "WorkingDirectory" --value) + if [[ $env_dir = "" ]]; + then + env_dir = $install_dir + fi + + cd $env_dir su -s /bin/bash $app }