From 8db9f40001358ed45094369b063ac34bc60d0576 Mon Sep 17 00:00:00 2001 From: cmdr2 Date: Fri, 2 Sep 2022 15:41:53 +0530 Subject: [PATCH] v2 scripts, trap more errors --- scripts/on_sd_start.bat | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/scripts/on_sd_start.bat b/scripts/on_sd_start.bat index 8c000815..8120d88d 100644 --- a/scripts/on_sd_start.bat +++ b/scripts/on_sd_start.bat @@ -1,3 +1,5 @@ +@set cmd_had_error=F + @>nul grep -c "sd_git_cloned" scripts\install_status.txt @if "%ERRORLEVEL%" EQU "0" ( @echo "Stable Diffusion's git repository was already installed. Updating.." @@ -14,6 +16,14 @@ @call git clone https://github.com/basujindal/stable-diffusion.git && ( @echo sd_git_cloned >> scripts\install_status.txt ) || ( + @set cmd_had_error=T + ) + + if "%ERRORLEVEL%" NEQ "0" ( + @set cmd_had_error=T + ) + + if "%cmd_had_error%"=="T" ( @echo "Error downloading Stable Diffusion. Please try re-running this installer. If it doesn't work, please copy the messages in this window, and ask the community at https://discord.com/invite/u9yhsFmEkB or file an issue at https://github.com/cmdr2/stable-diffusion-ui/issues" pause @exit /b @@ -33,6 +43,14 @@ @call conda env create --prefix env -f environment.yaml && ( @echo conda_sd_env_created >> ..\scripts\install_status.txt ) || ( + @set cmd_had_error=T + ) + + if "%ERRORLEVEL%" NEQ "0" ( + @set cmd_had_error=T + ) + + if "%cmd_had_error%"=="T" ( echo "Error installing the packages necessary for Stable Diffusion. Please try re-running this installer. If it doesn't work, please copy the messages in this window, and ask the community at https://discord.com/invite/u9yhsFmEkB or file an issue at https://github.com/cmdr2/stable-diffusion-ui/issues" pause exit /b @@ -50,6 +68,14 @@ @call conda install -c conda-forge -y --prefix env uvicorn fastapi && ( @echo conda_sd_ui_deps_installed >> ..\scripts\install_status.txt ) || ( + @set cmd_had_error=T + ) + + if "%ERRORLEVEL%" NEQ "0" ( + @set cmd_had_error=T + ) + + if "%cmd_had_error%"=="T" ( echo "Error installing the packages necessary for Stable Diffusion UI. Please try re-running this installer. If it doesn't work, please copy the messages in this window, and ask the community at https://discord.com/invite/u9yhsFmEkB or file an issue at https://github.com/cmdr2/stable-diffusion-ui/issues" pause exit /b