improved updater
This commit is contained in:
parent
c0030b77b0
commit
d6c6605e2a
2 changed files with 9 additions and 5 deletions
12
updater.py
12
updater.py
|
@ -2,15 +2,19 @@ import subprocess
|
|||
import time
|
||||
import sys
|
||||
import os
|
||||
import logging
|
||||
|
||||
|
||||
logger = logging.getLogger("goober")
|
||||
|
||||
def force_update() -> None:
|
||||
print("Forcefully updating...")
|
||||
logger.info("Forcefully updating...")
|
||||
stash = subprocess.run(["git", "stash"], capture_output=True)
|
||||
print(stash)
|
||||
logger.info(stash)
|
||||
pull = subprocess.run(["git", "pull", "origin", "main"], check=True, capture_output=True)
|
||||
print(pull)
|
||||
logger.info(pull)
|
||||
|
||||
print("Starting bot")
|
||||
logger.info("Starting bot")
|
||||
os.execv(sys.executable, [sys.executable, "bot.py"])
|
||||
|
||||
force_update()
|
Loading…
Add table
Add a link
Reference in a new issue