Skip to content

Commit

Permalink
Integrate cloning in linux setup script
Browse files Browse the repository at this point in the history
  • Loading branch information
bmaltais committed Mar 2, 2024
1 parent c474e16 commit 143de5b
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
3 changes: 3 additions & 0 deletions gui.sh
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ if [[ -z "${LD_LIBRARY_PATH}" ]]; then
echo -e " "
fi

# Clone or checkout release branch if required:
python "$SCRIPT_DIR/setup/setup_sd-scripts.py"

# Determine the requirements file based on the system
if [[ "$OSTYPE" == "darwin"* ]]; then
if [[ "$(uname -m)" == "arm64" ]]; then
Expand Down
30 changes: 30 additions & 0 deletions setup/setup_sd-scripts.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import os
import sys
import setup_common

# Get the absolute path of the current file's directory (Kohua_SS project directory)
project_directory = os.path.dirname(os.path.abspath(__file__))

# Check if the "setup" directory is present in the project_directory
if "setup" in project_directory:
# If the "setup" directory is present, move one level up to the parent directory
project_directory = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))

# Add the project directory to the beginning of the Python search path
sys.path.insert(0, project_directory)

from kohya_gui.custom_logging import setup_logging

# Set up logging
log = setup_logging()

def main():
# Read the tag version from the file
tag_version = setup_common.read_tag_version_from_file(".\.sd-scripts-release")

setup_common.clone_or_checkout(
"https://github.com/kohya-ss/sd-scripts.git", tag_version, "sd-scripts"
)

if __name__ == '__main__':
main()

0 comments on commit 143de5b

Please sign in to comment.