diff --git a/hack/publish.py b/hack/publish.py index 28707fb..adc303b 100644 --- a/hack/publish.py +++ b/hack/publish.py @@ -60,13 +60,12 @@ def mike(args: list[str]) -> None: Raises: Exception: If Mike command execution returns a non-zero exit code. """ - rc = subprocess.run( + subprocess.run( ["mike"] + args, stdout=sys.stdout, stderr=sys.stderr, + check=True, ) - if rc.returncode != 0: - raise Exception(rc.stderr) def is_initial() -> bool: @@ -76,11 +75,21 @@ def is_initial() -> bool: Returns: bool: True if the repository state is initial, False otherwise. """ - subprocess.run(["git", "fetch", "origin", "gh-pages"]) + logger.info("fetching gh-pages from origin") + subprocess.run( + ["git", "fetch", "origin", "gh-pages"], + stdout=sys.stdout, + stderr=sys.stderr, + ) + logger.info("getting ref of gh-pages") rc = subprocess.run( ["git", "show-ref", "--quiet", "refs/heads/gh-pages"], + stdout=sys.stdout, + stderr=sys.stderr, ) + + logger.info(f"returncode={rc.returncode}") return rc.returncode != 0