mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
Merge pull request #1756 from YunoHost/enh_app_shell
Enhance app shells
This commit is contained in:
commit
7f13ea7d65
1 changed files with 9 additions and 0 deletions
|
@ -196,6 +196,15 @@ ynh_spawn_app_shell() {
|
|||
set +a
|
||||
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
|
||||
local env_dir=$(systemctl show $service.service -p "WorkingDirectory" --value)
|
||||
[ -z $env_dir ] && env_dir=$install_dir;
|
||||
|
|
Loading…
Add table
Reference in a new issue