Add conditional check for git checkout in development path

Only insert development path into sys.path when running from a git checkout
(when ../.git exists). This makes the script more robust by only using the
development tree when available and falling back to installed package otherwise.
This commit is contained in:
Eric Wheeler
2025-07-19 17:17:58 -07:00
parent 773ccecb8c
commit 1bad563e3f

View File

@@ -4,6 +4,15 @@ import logging
import os
import sys
# If we are running from a git-checkout, we can run against the development
# tree without installing.
if os.path.exists(os.path.join(os.path.dirname(__file__), "..", ".git")):
sys.path.insert(
0, os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))
)
from github_backup.github_backup import (
backup_account,
backup_repositories,