Skip to content

Commit

Permalink
Suppress the output of internal call to git or svn
Browse files Browse the repository at this point in the history
  • Loading branch information
basicthinker committed Jun 6, 2023
1 parent 38a9f2d commit 6548ebb
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions devchat/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,9 @@ def setup_logger(file_path, level=logging.WARNING):
def find_root_dir() -> Optional[str]:
root = None
try:
result = subprocess.check_output(["git", "rev-parse", "--show-toplevel"])
root = result.decode("utf-8").strip()
result = subprocess.run(["git", "rev-parse", "--show-toplevel"],
capture_output=True, text=True, check=True)
root = result.stdout.strip()
except subprocess.CalledProcessError:
try:
result = subprocess.run(["svn", "info"], capture_output=True, text=True, check=True)
Expand Down

0 comments on commit 6548ebb

Please sign in to comment.