Skip to content

Commit

Permalink
Merge pull request #1756 from YunoHost/enh_app_shell
Browse files Browse the repository at this point in the history
Enhance app shells
  • Loading branch information
alexAubin authored Jan 12, 2024
2 parents 43c0c33 + 1c08384 commit 7f13ea7
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions helpers/apps
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 7f13ea7

Please sign in to comment.