mirror of
https://github.com/TrezOne/docker-mods-uptime-kuma-timeout-fix.git
synced 2026-07-21 10:34:14 -04:00
Don't create venv if pip is already installed
This commit is contained in:
+1
-5
@@ -42,7 +42,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 [[ ! -d /lsiopy/bin ]]; then
|
if ! command -v pip; then
|
||||||
echo "**** Creating venv ****"
|
echo "**** Creating venv ****"
|
||||||
python3 -m venv /lsiopy
|
python3 -m venv /lsiopy
|
||||||
fi
|
fi
|
||||||
@@ -52,12 +52,8 @@ if [[ -f "/mod-pip-packages-to-install.list" ]]; then
|
|||||||
PIP_ARGS+=("-f" "https://wheel-index.linuxserver.io/ubuntu/")
|
PIP_ARGS+=("-f" "https://wheel-index.linuxserver.io/ubuntu/")
|
||||||
elif [[ -f /sbin/apk ]]; then
|
elif [[ -f /sbin/apk ]]; then
|
||||||
ALPINE_VER=$(grep main /etc/apk/repositories | sed 's|.*alpine/v||' | sed 's|/main.*||')
|
ALPINE_VER=$(grep main /etc/apk/repositories | sed 's|.*alpine/v||' | sed 's|/main.*||')
|
||||||
if [[ "${ALPINE_VER}" = "3.14" ]]; then
|
|
||||||
PIP_ARGS+=("-f" "https://wheel-index.linuxserver.io/alpine/")
|
|
||||||
else
|
|
||||||
PIP_ARGS+=("-f" "https://wheel-index.linuxserver.io/alpine-${ALPINE_VER}/")
|
PIP_ARGS+=("-f" "https://wheel-index.linuxserver.io/alpine-${ALPINE_VER}/")
|
||||||
fi
|
fi
|
||||||
fi
|
|
||||||
python3 -m pip install \
|
python3 -m pip install \
|
||||||
"${PIP_ARGS[@]}" \
|
"${PIP_ARGS[@]}" \
|
||||||
"${PIP_PACKAGES[@]}"
|
"${PIP_PACKAGES[@]}"
|
||||||
|
|||||||
Reference in New Issue
Block a user