Enable gh-deploy to work if the mkdocs.yml is not in the repo root

Fixes #578
This commit is contained in:
Dougal Matthews
2015-06-05 14:52:09 +01:00
parent b38cdcd5d8
commit ca5d6f918f
2 changed files with 8 additions and 4 deletions

View File

@@ -17,11 +17,13 @@ You can determine your currently installed version using `mkdocs --version`:
* Improve Unicode handling by ensuring that all YAML strings are loaded as Unicode.
* Remove dependancy on the six library. (#583)
* Remove dependancy on the ghp-import library. (#547)
* Add `--quiet` and `--verbose` options to all subcommands.
* Add short options (`-a`) to most command line options.
* Add copyright footer for readthedocs theme.
* Bugfix: Fix a JavaScript encoding problem when searching with spaces. (#586)
* Stack traces are no longer displayed on socket errors, just an error message.
* Bugfix: gh-deploy now works if the mkdocs.yml is not in the git repo root (#578)
## Version 0.13.3 (2015-06-02)

View File

@@ -8,10 +8,12 @@ log = logging.getLogger(__name__)
def gh_deploy(config, message=None):
if not os.path.exists('.git'):
log.info('Cannot deploy - this directory does not appear to be a git '
'repository')
return
proc = subprocess.Popen(['git', 'rev-parse', '--is-inside-work-tree'],
stdout=subprocess.PIPE, stderr=subprocess.PIPE)
proc.communicate()
if proc.wait() != 0:
log.error('Cannot deploy - this directory does not appear to be a git '
'repository')
command = ['ghp-import', '-p', config['site_dir']]