aboutsummaryrefslogtreecommitdiff
path: root/webui.sh
diff options
context:
space:
mode:
authorAUTOMATIC1111 <16777216c@gmail.com>2023-07-08 14:19:34 +0300
committerGitHub <noreply@github.com>2023-07-08 14:19:34 +0300
commitfc049a2fd3fe4a7d5859ae004d81f30e59f42d06 (patch)
tree15af914a7967a317abd7d9e0975dc4b2c17376cd /webui.sh
parent522a8b9f629940a205812b5b023f25c051f3c8d8 (diff)
parentae74b44c69a40c3b2f2a91f5ee4160e6d8bbd31e (diff)
Merge branch 'dev' into better-status-reporting-1
Diffstat (limited to 'webui.sh')
-rwxr-xr-xwebui.sh12
1 files changed, 7 insertions, 5 deletions
diff --git a/webui.sh b/webui.sh
index 5c8d977c..246381fc 100755
--- a/webui.sh
+++ b/webui.sh
@@ -4,26 +4,28 @@
# 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 [[ "$OSTYPE" == "darwin"* ]]; then
- if [[ -f webui-macos-env.sh ]]
+ if [[ -f "$SCRIPT_DIR"/webui-macos-env.sh ]]
then
- source ./webui-macos-env.sh
+ source "$SCRIPT_DIR"/webui-macos-env.sh
fi
fi
# Read variables from webui-user.sh
# shellcheck source=/dev/null
-if [[ -f webui-user.sh ]]
+if [[ -f "$SCRIPT_DIR"/webui-user.sh ]]
then
- source ./webui-user.sh
+ source "$SCRIPT_DIR"/webui-user.sh
fi
# Set defaults
# Install directory without trailing slash
if [[ -z "${install_dir}" ]]
then
- install_dir="$(pwd)"
+ install_dir="$SCRIPT_DIR"
fi
# Name of the subdirectory (defaults to stable-diffusion-webui)