Skip to content

Commit

Permalink
Update gui.sh to be more location independent
Browse files Browse the repository at this point in the history
  • Loading branch information
jstayco committed Apr 3, 2023
1 parent 9c8c480 commit d0d8bc8
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions gui.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
#!/usr/bin/env bash

# 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)"

# Activate the virtual environment
source ./venv/bin/activate
source "$SCRIPT_DIR/venv/bin/activate"

# If the requirements are validated, run the kohya_gui.py script with the command-line arguments
if python tools/validate_requirements.py; then
python kohya_gui.py "$@"
python "$SCRIPT_DIR/kohya_gui.py" "$@"
fi

0 comments on commit d0d8bc8

Please sign in to comment.