Skip to content

Commit

Permalink
Use check_output to output latest hash, Fix pip conditional
Browse files Browse the repository at this point in the history
  • Loading branch information
nattadasu committed May 5, 2024
1 parent 97fc9c2 commit 6a54395
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions extensions/update_host.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ def _check_upstream_commit() -> str:
"""Check if there is any new commit in the upstream"""
sub_run("git fetch", shell=True)
upstream_commit = (
sub_run("git rev-parse origin", shell=True, check=True)
.stdout.decode()
chout(["git", "rev-parse", "origin"], shell=True)
.decode("utf-8")
.strip()
)
return upstream_commit
Expand All @@ -49,9 +49,9 @@ def _update_pip_dependencies(is_dev: bool = False) -> bool:
"""Update the pip dependencies"""
dev = "-dev" if is_dev else ""
deps = chout(
f"pip install -r requirements{dev}.txt", shell=True).decode()
f"pip install -r requirements{dev}.txt", shell=True).decode("utf-8")
# check if the dependencies are updated
if "Requirement already satisfied" in deps:
if "Successfully installed" in deps:
return True
return False

Expand Down

0 comments on commit 6a54395

Please sign in to comment.