From 873d4bd3f2017c0f17bd52f13310f8a804afce52 Mon Sep 17 00:00:00 2001 From: cmdr2 Date: Thu, 27 Oct 2022 19:47:20 +0530 Subject: [PATCH] Retry micromamba download on windows --- scripts/bootstrap.bat | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/scripts/bootstrap.bat b/scripts/bootstrap.bat index ca57bc36..27004ca2 100644 --- a/scripts/bootstrap.bat +++ b/scripts/bootstrap.bat @@ -11,6 +11,7 @@ set MAMBA_ROOT_PREFIX=%cd%\installer_files\mamba set INSTALL_ENV_DIR=%cd%\installer_files\env set LEGACY_INSTALL_ENV_DIR=%cd%\installer set MICROMAMBA_DOWNLOAD_URL=https://github.com/cmdr2/stable-diffusion-ui/releases/download/v1.1/micromamba.exe +set umamba_exists=F @rem figure out whether git and conda needs to be installed if exist "%INSTALL_ENV_DIR%" set PATH=%INSTALL_ENV_DIR%;%INSTALL_ENV_DIR%\Library\bin;%INSTALL_ENV_DIR%\Scripts;%INSTALL_ENV_DIR%\Library\usr\bin;%PATH% @@ -24,15 +25,13 @@ if not exist "%LEGACY_INSTALL_ENV_DIR%\etc\profile.d\conda.sh" ( call git --version >.tmp1 2>.tmp2 if "%ERRORLEVEL%" NEQ "0" set PACKAGES_TO_INSTALL=%PACKAGES_TO_INSTALL% git +call "%MAMBA_ROOT_PREFIX%\micromamba.exe" --version >.tmp1 2>.tmp2 +if "%ERRORLEVEL%" EQU "0" set umamba_exists=T + @rem (if necessary) install git and conda into a contained environment if "%PACKAGES_TO_INSTALL%" NEQ "" ( @rem download micromamba - set download_umamba=T - - call "%MAMBA_ROOT_PREFIX%\micromamba.exe" --version >.tmp1 2>.tmp2 - if "%ERRORLEVEL%" EQU "0" set download_umamba=F - - if "%download_umamba%" == "T" ( + if "%umamba_exists%" == "F" ( echo "Downloading micromamba from %MICROMAMBA_DOWNLOAD_URL% to %MAMBA_ROOT_PREFIX%\micromamba.exe" mkdir "%MAMBA_ROOT_PREFIX%"