From b02fb86765569e685f42313b3b6a5a2bf0644aea Mon Sep 17 00:00:00 2001 From: JSTayco Date: Fri, 31 Mar 2023 19:30:43 -0700 Subject: [PATCH] Small README update Updates README to cover new location change and adds one small comment to clarify a variable --- README.md | 6 ++++-- setup.sh | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 94b9466..66554b3 100644 --- a/README.md +++ b/README.md @@ -96,9 +96,11 @@ Options: #### Install location -The default install location for Linux is `/opt/kohya_ss`. If /opt is not writeable, the fallback is `$HOME/kohya_ss`. Lastly, if all else fails it will simply install to the current folder you are in. +The default install location for Linux is where the script is located if a previous installation is detected that location. +Otherwise, it will fall to `/opt/kohya_ss`. If /opt is not writeable, the fallback is `$HOME/kohya_ss`. Lastly, if all else fails it will simply install to the current folder you are in (PWD). -On macOS and other non-Linux machines, it will default install to `$HOME/kohya_ss` followed by where you're currently at if there's no access to $HOME. +On macOS and other non-Linux machines, it will first try to detect an install where the script is run from and then run setup there if that's detected. +If a previous install isn't found at that location, then it will default install to `$HOME/kohya_ss` followed by where you're currently at if there's no access to $HOME. You can override this behavior by specifying an install directory with the -d option. If you are using the interactive mode, our default values for the accelerate config screen after running the script answer "This machine", "None", "No" for the remaining questions. diff --git a/setup.sh b/setup.sh index 14de32d..c0f0f79 100755 --- a/setup.sh +++ b/setup.sh @@ -46,6 +46,7 @@ if env_var_exists RUNPOD_POD_ID || env_var_exists RUNPOD_API_KEY; then RUNPOD=true fi +# This gets the directory the script is run from so pathing can work relative to the script where needed. SCRIPT_DIR="$(cd -- $(dirname -- "$0") && pwd)" # Variables defined before the getopts loop, so we have sane default values.