diff options
author | AUTOMATIC1111 <16777216c@gmail.com> | 2023-07-08 10:57:01 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-07-08 10:57:01 +0000 |
commit | e338f4142fd77f91f73ae82654327acce73dfb71 (patch) | |
tree | 9ac4429f91f653a2094cf7a05d478affe185df1d /webui.sh | |
parent | 3a294a08bc521b5dbd00df5facce525fd498971b (diff) | |
parent | e33e2c51753b91d836aabc52f1f8d67d7de05f86 (diff) | |
download | stable-diffusion-webui-gfx803-e338f4142fd77f91f73ae82654327acce73dfb71.tar.gz stable-diffusion-webui-gfx803-e338f4142fd77f91f73ae82654327acce73dfb71.tar.bz2 stable-diffusion-webui-gfx803-e338f4142fd77f91f73ae82654327acce73dfb71.zip |
Merge pull request #11592 from onyasumi/launchscript-directory
Fixed launch script to be runnable from any directory
Diffstat (limited to 'webui.sh')
-rwxr-xr-x | webui.sh | 12 |
1 files changed, 7 insertions, 5 deletions
@@ -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) |