Commit e338f414 authored by AUTOMATIC1111's avatar AUTOMATIC1111 Committed by GitHub

Merge pull request #11592 from onyasumi/launchscript-directory

Fixed launch script to be runnable from any directory
parents 3a294a08 e33e2c51
...@@ -4,26 +4,28 @@ ...@@ -4,26 +4,28 @@
# change the variables in webui-user.sh instead # # change the variables in webui-user.sh instead #
################################################# #################################################
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
# If run from macOS, load defaults from webui-macos-env.sh # If run from macOS, load defaults from webui-macos-env.sh
if [[ "$OSTYPE" == "darwin"* ]]; then if [[ "$OSTYPE" == "darwin"* ]]; then
if [[ -f webui-macos-env.sh ]] if [[ -f "$SCRIPT_DIR"/webui-macos-env.sh ]]
then then
source ./webui-macos-env.sh source "$SCRIPT_DIR"/webui-macos-env.sh
fi fi
fi fi
# Read variables from webui-user.sh # Read variables from webui-user.sh
# shellcheck source=/dev/null # shellcheck source=/dev/null
if [[ -f webui-user.sh ]] if [[ -f "$SCRIPT_DIR"/webui-user.sh ]]
then then
source ./webui-user.sh source "$SCRIPT_DIR"/webui-user.sh
fi fi
# Set defaults # Set defaults
# Install directory without trailing slash # Install directory without trailing slash
if [[ -z "${install_dir}" ]] if [[ -z "${install_dir}" ]]
then then
install_dir="$(pwd)" install_dir="$SCRIPT_DIR"
fi fi
# Name of the subdirectory (defaults to stable-diffusion-webui) # Name of the subdirectory (defaults to stable-diffusion-webui)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment