v2 scripts, trap more errors

This commit is contained in:
cmdr2 2022-09-02 15:41:53 +05:30
parent 472b8d0e51
commit 8db9f40001

View File

@ -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