Skip to content

Commit

Permalink
Fixed esdc-docs git checkout
Browse files Browse the repository at this point in the history
Related to #338
  • Loading branch information
dn0 committed Apr 15, 2018
1 parent 50a663f commit b4a6261
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion core/management/commands/gendoc.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import os
import re
import shutil

from ._base import DanubeCloudCommand, CommandOption, CommandError, lcd

Expand Down Expand Up @@ -63,13 +64,17 @@ def gendoc_user_guide(self, fallback_branch='master'):
else:
self.display('We are on branch "%s"' % branch)

if self._path_exists(self.DOC_TMP_DIR):
if self._path_exists(self.DOC_TMP_DIR, 'user-guide', 'conf.py'):
existing_repo = True
self.display('%s already exists in %s' % (self.DOC_REPO, self.DOC_TMP_DIR), color='yellow')
with lcd(self.DOC_TMP_DIR):
self.local('git fetch')
self.display('%s has been successfully updated.' % self.DOC_REPO, color='green')
else:
if self._path_exists(self.DOC_TMP_DIR):
self.display('Removing stale %s', self.DOC_TMP_DIR, color='yellow')
shutil.rmtree(self.DOC_TMP_DIR)

existing_repo = False
self.local('git clone %s %s' % (self.DOC_REPO, self.DOC_TMP_DIR))
self.display('%s has been successfully cloned.' % self.DOC_TMP_DIR, color='green')
Expand Down

0 comments on commit b4a6261

Please sign in to comment.