|
import os |
|
from pathlib import Path |
|
|
|
from launch import git, run |
|
|
|
REPO_LOCATION = Path(__file__).parent |
|
auto_update = os.environ.get("AUTO_UPDATE", "True").lower() in {"true", "yes"} |
|
|
|
if auto_update: |
|
print("[auto-sd-paint-ext] Attempting auto-update...") |
|
|
|
try: |
|
|
|
|
|
|
|
|
|
|
|
run(f'"{git}" -C "{REPO_LOCATION}" fetch', "[auto-sd-paint-ext] Fetch upstream.") |
|
|
|
run(f'"{git}" -C "{REPO_LOCATION}" pull', "[auto-sd-paint-ext] Pull upstream.") |
|
except Exception as e: |
|
print("[auto-sd-paint-ext] Auto-update failed:") |
|
print(e) |
|
print("[auto-sd-paint-ext] Ensure git was used to install extension.") |
|
|
|
|
|
|