Navigation Menu

Skip to content

Commit

Permalink
Provide sensible error message when git not found (#1797)
Browse files Browse the repository at this point in the history
  • Loading branch information
onelivesleft authored and waylan committed Nov 27, 2019
1 parent f44428c commit 98823e0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
1 change: 1 addition & 0 deletions docs/about/release-notes.md
Expand Up @@ -65,6 +65,7 @@ your global navigation uses more than one level, things will likely be broken.
* Bugfix: Skip external URLs in sitemap.xml (#1742).
* Bugfix: Ensure theme files do not override docs_dir files on Windows (#1876)
* Add canonical tag to `readthedocs` theme (#1669).
* Improved error message for when `git` is not available.

## Version 1.0.4 (2018-09-07)

Expand Down
11 changes: 9 additions & 2 deletions mkdocs/commands/gh_deploy.py
Expand Up @@ -14,8 +14,15 @@


def _is_cwd_git_repo():
proc = subprocess.Popen(['git', 'rev-parse', '--is-inside-work-tree'],
stdout=subprocess.PIPE, stderr=subprocess.PIPE)
try:
proc = subprocess.Popen(
['git', 'rev-parse', '--is-inside-work-tree'],
stdout=subprocess.PIPE,
stderr=subprocess.PIPE
)
except FileNotFoundError:
log.error("Could not find git - is it installed and on your path?")
raise SystemExit(1)
proc.communicate()
return proc.wait() == 0

Expand Down

0 comments on commit 98823e0

Please sign in to comment.