Prefer the locally installed conda over any global conda installation; activate the env before updating

This commit is contained in:
cmdr2 2022-10-13 10:56:04 +05:30 committed by tildebyte
parent 90c8aa716d
commit da012e1bfd
3 changed files with 8 additions and 3 deletions

View File

@ -56,7 +56,7 @@ if [ "$PACKAGES_TO_INSTALL" != "" ]; then
"$MAMBA_ROOT_PREFIX/micromamba" install -y --prefix "$INSTALL_ENV_DIR" -c conda-forge $PACKAGES_TO_INSTALL
fi
if [ -e "$INSTALL_ENV_DIR" ]; then export PATH="$PATH:$INSTALL_ENV_DIR/bin"; fi
if [ -e "$INSTALL_ENV_DIR" ]; then export PATH="$INSTALL_ENV_DIR/bin:$PATH"; fi
# get the repo (and load into the current directory)
if [ ! -e ".git" ]; then

View File

@ -2,7 +2,7 @@
if [ "$0" == "bash" ]; then
INSTALL_ENV_DIR="$(pwd)/installer_files/env"
if [ -e "$INSTALL_ENV_DIR" ]; then export PATH="$PATH:$INSTALL_ENV_DIR/bin"; fi
if [ -e "$INSTALL_ENV_DIR" ]; then export PATH="$INSTALL_ENV_DIR/bin:$PATH"; fi
CONDA_BASEPATH=$(conda info --base)
source "$CONDA_BASEPATH/etc/profile.d/conda.sh" # otherwise conda complains about 'shell not initialized' (needed when running in a script)

View File

@ -1,13 +1,18 @@
#!/bin/bash
INSTALL_ENV_DIR="$(pwd)/installer_files/env"
if [ -e "$INSTALL_ENV_DIR" ]; then export PATH="$PATH:$INSTALL_ENV_DIR/bin"; fi
if [ -e "$INSTALL_ENV_DIR" ]; then export PATH="$INSTALL_ENV_DIR/bin:$PATH"; fi
# update the repo
if [ -e ".git" ]; then
git pull
fi
CONDA_BASEPATH=$(conda info --base)
source "$CONDA_BASEPATH/etc/profile.d/conda.sh" # otherwise conda complains about 'shell not initialized' (needed when running in a script)
conda activate invokeai
OS_NAME=$(uname -s)
case "${OS_NAME}" in
Linux*) conda env update;;