mirror of
https://github.com/TrezOne/docker-mods-uptime-kuma-timeout-fix.git
synced 2026-07-18 08:48:27 -04:00
Only create a venv when we're installing python ourselves
This commit is contained in:
+12
-9
@@ -4,14 +4,17 @@
|
|||||||
if [[ -f "/mod-pip-packages-to-install.list" ]]; then
|
if [[ -f "/mod-pip-packages-to-install.list" ]]; then
|
||||||
IFS=' ' read -ra PIP_PACKAGES <<< "$(tr '\n' ' ' < /mod-pip-packages-to-install.list)"
|
IFS=' ' read -ra PIP_PACKAGES <<< "$(tr '\n' ' ' < /mod-pip-packages-to-install.list)"
|
||||||
if [[ ${#PIP_PACKAGES[@]} -ne 0 ]] && [[ ${PIP_PACKAGES[*]} != "" ]]; then
|
if [[ ${#PIP_PACKAGES[@]} -ne 0 ]] && [[ ${PIP_PACKAGES[*]} != "" ]]; then
|
||||||
if [[ -f /usr/bin/apt ]]; then
|
if ! command -v python3; then
|
||||||
echo "python3-venv" >> /mod-repo-packages-to-install.list
|
CREATE_VENV="true"
|
||||||
elif [[ -f /sbin/apk ]]; then
|
if [[ -f /usr/bin/apt ]]; then
|
||||||
echo "python3" >> /mod-repo-packages-to-install.list
|
echo "python3-venv" >> /mod-repo-packages-to-install.list
|
||||||
elif [[ -f /usr/sbin/pacman ]]; then
|
elif [[ -f /sbin/apk ]]; then
|
||||||
echo "python" >> /mod-repo-packages-to-install.list
|
echo "python3" >> /mod-repo-packages-to-install.list
|
||||||
elif [[ -f /usr/bin/dnf ]]; then
|
elif [[ -f /usr/sbin/pacman ]]; then
|
||||||
echo "python3" >> /mod-repo-packages-to-install.list
|
echo "python" >> /mod-repo-packages-to-install.list
|
||||||
|
elif [[ -f /usr/bin/dnf ]]; then
|
||||||
|
echo "python3" >> /mod-repo-packages-to-install.list
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
@@ -42,7 +45,7 @@ if [[ -f "/mod-pip-packages-to-install.list" ]]; then
|
|||||||
IFS=' ' read -ra PIP_PACKAGES <<< "$(tr '\n' ' ' < /mod-pip-packages-to-install.list)"
|
IFS=' ' read -ra PIP_PACKAGES <<< "$(tr '\n' ' ' < /mod-pip-packages-to-install.list)"
|
||||||
if [[ ${#PIP_PACKAGES[@]} -ne 0 ]] && [[ ${PIP_PACKAGES[*]} != "" ]]; then
|
if [[ ${#PIP_PACKAGES[@]} -ne 0 ]] && [[ ${PIP_PACKAGES[*]} != "" ]]; then
|
||||||
echo "[mod-init] **** Installing all pip packages ****"
|
echo "[mod-init] **** Installing all pip packages ****"
|
||||||
if ! command -v pip; then
|
if [[ ${CREATE_VENV} == "true" ]]; then
|
||||||
echo "**** Creating venv ****"
|
echo "**** Creating venv ****"
|
||||||
python3 -m venv /lsiopy
|
python3 -m venv /lsiopy
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user