From e286a7aeda4c163efb9419b0eaff7d43b7a390b0 Mon Sep 17 00:00:00 2001 From: rosbeef andino Date: Fri, 13 Oct 2023 00:31:03 +0000 Subject: [PATCH] Update _common.sh --- scripts/_common.sh | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/scripts/_common.sh b/scripts/_common.sh index 6359465..fa51d3b 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -201,7 +201,16 @@ myynh_install_homeassistant () { myynh_upgrade_venv_directory () { # Remove old python links before recreating them - find "$install_dir/bin/" -type l -name 'python*' -exec bash -c 'rm -f "$1"' _ {} \; + find "$install_dir/bin/" -type l -name 'python*' \ + -exec bash -c 'rm --force "$1"' _ {} \; + + # Remove old python directories before recreating them + find "$install_dir/lib/" -mindepth 1 -maxdepth 1 -type d -name "python*" \ + -not -path "*/python${py_required_version%.*}" \ + -exec bash -c 'rm --force --recursive "$1"' _ {} \; + find "$install_dir/include/site/" -mindepth 1 -maxdepth 1 -type d -name "python*" \ + -not -path "*/python${py_required_version%.*}" \ + -exec bash -c 'rm --force --recursive "$1"' _ {} \; # Upgrade the virtual environment directory ynh_exec_as $app $py_app_version -m venv --upgrade "$install_dir"