Skip to content

Commit

Permalink
after initial test
Browse files Browse the repository at this point in the history
  • Loading branch information
dianzrong committed Jun 21, 2023
1 parent ed26aad commit 18b0e4c
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions openadapt/start.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
Usage:
python3 -m openadapt.start
"""

from loguru import logger
import subprocess

from openadapt.app.main import run_app
# from openadapt.app.main import run_app


def changes_needed(result: str) -> bool:
Expand All @@ -31,16 +31,16 @@ def start_openadapt_app() -> None:
"""
result = subprocess.run(["git", "status"], capture_output=True, text=True)

if "branch is up to date" not in result.stdout:
if changes_needed(result.stdout):
subprocess.run(["git", "stash"])
print("Changes stashed")
if changes_needed(result.stdout):
subprocess.run(["git", "stash"])
print("Changes stashed")

subprocess.run(["git", "pull"])
print("Updated the OpenAdapt App")
subprocess.run(["git", "pull", "1>$null"])
print("Updated the OpenAdapt App")

run_app() # start gui
# run_app() # start gui


if __name__ == "__main__":
start_openadapt_app()
logger.info("updated")

0 comments on commit 18b0e4c

Please sign in to comment.