From df4dbe2d57b41d604edd561f4ee39156119fdc07 Mon Sep 17 00:00:00 2001 From: Max Date: Fri, 9 Aug 2024 10:14:53 +0200 Subject: [PATCH] Fix invoke.sh not detecting symlinks When invoke.sh is executed using a symlink with a working directory outside of InvokeAI's root directory, it will fail. invoke.sh attempts to cd into the correct directory at the start of the script, but will cd into the directory of the symlink instead. This commit fixes that. --- installer/templates/invoke.sh.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/installer/templates/invoke.sh.in b/installer/templates/invoke.sh.in index b8d5a7af23..0bc6bbb471 100644 --- a/installer/templates/invoke.sh.in +++ b/installer/templates/invoke.sh.in @@ -17,7 +17,7 @@ set -eu # Ensure we're in the correct folder in case user's CWD is somewhere else -scriptdir=$(dirname "$0") +scriptdir=$(dirname $(readlink -f "$0")) cd "$scriptdir" . .venv/bin/activate