Merge pull request #1756 from YunoHost/enh_app_shell

Enhance app shells
This commit is contained in:
Alexandre Aubin 2024-01-12 23:07:22 +01:00 committed by GitHub
commit 7f13ea7d65
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -196,6 +196,15 @@ ynh_spawn_app_shell() {
set +a set +a
fi fi
# Activate the Python environment, if it exists
if [ -f $install_dir/venv/bin/activate ]
then
# set -/+a enables and disables new variables being automatically exported. Needed when using `source`.
set -a
source $install_dir/venv/bin/activate
set +a
fi
# cd into the WorkingDirectory set in the service, or default to the install_dir # cd into the WorkingDirectory set in the service, or default to the install_dir
local env_dir=$(systemctl show $service.service -p "WorkingDirectory" --value) local env_dir=$(systemctl show $service.service -p "WorkingDirectory" --value)
[ -z $env_dir ] && env_dir=$install_dir; [ -z $env_dir ] && env_dir=$install_dir;