Skip to content

Commit

Permalink
Merge pull request #23 from jsk-ros-pkg/update_even_if_exists
Browse files Browse the repository at this point in the history
Update documentation repo even if it exists
  • Loading branch information
k-okada committed Jul 10, 2017
2 parents 3efa062 + 3d79567 commit 852b6cf
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,12 @@
uri = os.path.splitext(repo['git']['uri'])[0]
version = repo['git']['version'] if repo['git'].has_key('version') else 'master'
print("wrokin on name:{} uri:{} branch:{}".format(local_name, uri, version))
subprocess.call(['git', 'clone', '--depth=1', uri, local_name, '-b', version])
if os.path.exists(local_name):
subprocess.call(['git', 'fetch', '--all'], cwd=local_name)
else:
subprocess.call(['git', 'clone', '--depth=1', uri, local_name, '-b', version])
subprocess.call(['git', 'clean', '-xfd'], cwd=local_name)
subprocess.call(['git', 'reset', '--hard'], cwd=local_name)
subprocess.call(['git', 'reset', '--hard', 'origin/%s' % version], cwd=local_name)

if "/" not in local_name:
with open("index.rst", "a") as f:
Expand Down

0 comments on commit 852b6cf

Please sign in to comment.