added restart
This commit is contained in:
parent
3705fd1866
commit
c0030b77b0
2 changed files with 32 additions and 0 deletions
16
updater.py
Normal file
16
updater.py
Normal file
|
@ -0,0 +1,16 @@
|
|||
import subprocess
|
||||
import time
|
||||
import sys
|
||||
import os
|
||||
|
||||
def force_update() -> None:
|
||||
print("Forcefully updating...")
|
||||
stash = subprocess.run(["git", "stash"], capture_output=True)
|
||||
print(stash)
|
||||
pull = subprocess.run(["git", "pull", "origin", "main"], check=True, capture_output=True)
|
||||
print(pull)
|
||||
|
||||
print("Starting bot")
|
||||
os.execv(sys.executable, [sys.executable, "bot.py"])
|
||||
|
||||
force_update()
|
Loading…
Add table
Add a link
Reference in a new issue