Skip to content

Commit

Permalink
fix: include useful message if VCS command not found (#66)
Browse files Browse the repository at this point in the history
  • Loading branch information
xzmeng committed Sep 19, 2023
1 parent 66b32c9 commit f0f5640
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/unearth/vcs/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,13 @@ def run_command(
logger.debug(e.stdout.rstrip())
return subprocess.CompletedProcess(e.args, e.returncode, e.stdout)
raise UnpackError(e.output) from None
except FileNotFoundError:
logger.debug(f"Cannot find `{self.name}`, PATH={os.environ.get('PATH')}")
msg = (
f"Unable to find executable `{self.name}`, "
"make sure it's installed in PATH."
)
raise FileNotFoundError(msg) from None
else:
if log_output:
logger.debug(result.stdout.rstrip())
Expand Down

0 comments on commit f0f5640

Please sign in to comment.