Update webui.sh

This enhancement introduces a crucial check for the existence of the 'stable-diffusion-webui' folder within the project directory. The motivation behind this addition is to mitigate potential conflicts when the project is situated within another Git repository, a situation often encountered when users operate live servers with their own Git configurations.

Previously, the absence of this check could lead to unintended interactions with the enclosing Git repository, resulting in unforeseen issues. Now, by verifying the presence of the 'stable-diffusion-webui' folder, the script ensures a more resilient and isolated deployment. If the folder exists, it is leveraged as the install directory, guaranteeing a seamless integration while minimizing the risk of interference with surrounding Git repositories.

This improvement aims to elevate compatibility and prevent unintended consequences, especially in scenarios where the project coexists within other Git-controlled environments.
This commit is contained in:
Muhammad Rehan Aslam 2024-01-12 15:59:26 +05:00 committed by GitHub
parent cb5b335acd
commit 2b5302768c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -113,15 +113,20 @@ then
exit 1
fi
if [[ -d .git ]]
then
printf "\n%s\n" "${delimiter}"
printf "Repo already cloned, using it as install directory"
printf "\n%s\n" "${delimiter}"
if [[ -d stable-diffusion-webui ]]; then
message="Folder 'stable-diffusion-webui' exists, using it as install directory"
install_dir="${install_dir}/stable-diffusion-webui"
clone_dir="${clone_dir}/stable-diffusion-webui"
elif [[ -d .git ]]; then
message="Repo already cloned, using it as install directory"
install_dir="${PWD}/../"
clone_dir="${PWD##*/}"
fi
if [[ -n "$message" ]]; then
printf "\n%s\n%s\n%s\n" "${delimiter}" "$message" "${delimiter}"
fi
# Check prerequisites
gpu_info=$(lspci 2>/dev/null | grep -E "VGA|Display")
case "$gpu_info" in