goober/updater.py

17 lines
382 B
Python
Raw Normal View History

2025-07-26 22:18:39 +03:00
import subprocess
import time
import sys
import os
2025-07-26 22:24:17 +03:00
import logging
logger = logging.getLogger("goober")
2025-07-26 22:18:39 +03:00
def force_update() -> None:
2025-07-26 22:24:17 +03:00
logger.info("Forcefully updating...")
2025-07-26 22:18:39 +03:00
stash = subprocess.run(["git", "stash"], capture_output=True)
2025-07-26 22:24:17 +03:00
logger.info(stash)
2025-07-26 22:18:39 +03:00
pull = subprocess.run(["git", "pull", "origin", "main"], check=True, capture_output=True)
2025-07-26 22:24:17 +03:00
logger.info(pull)
2025-07-26 22:18:39 +03:00