Default to WorkingDirectory then install_dir for ynh_spawn_app_shell

Co-authored-by: Tagada <36127788+Tagadda@users.noreply.github.com>
This commit is contained in:
tituspijean 2023-05-24 23:13:52 +02:00 committed by GitHub
parent cc167cd92c
commit 4b4ce9aef6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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
}