forked from tildetown/tilde-wiki
bugfix: new files weren't getting picked up.
this commit goes for the nuclear option of adding everything locally, pushing, and then hard resetting the remote repo.master
parent
729b63f78a
commit
6a7f95e118
|
@ -26,15 +26,16 @@ def make_commit(repo_path, author_name, author_email):
|
|||
return
|
||||
repo = gitpython.Repo(repo_path)
|
||||
index = repo.index
|
||||
|
||||
index.add([path for (path, _), __ in index.entries.items()])
|
||||
repo.git.add(['--all'])
|
||||
|
||||
actor = gitpython.Actor(author_name, author_email)
|
||||
index.commit('wiki update', author=actor, committer=actor)
|
||||
|
||||
def push_all(repo_path):
|
||||
repo = gitpython.Repo(repo_path)
|
||||
repo.remotes['origin'].push()
|
||||
def push_hard(local_repo_path, remote_repo_path):
|
||||
local_repo = gitpython.Repo(local_repo_path)
|
||||
local_repo.remotes['origin'].push()
|
||||
remote = gitpython.Repo(remote_repo_path)
|
||||
remote.git.reset(['--hard', 'HEAD'])
|
||||
|
||||
def pull_from_origin(repo_path):
|
||||
repo = gitpython.Repo(repo_path)
|
||||
|
|
|
@ -137,7 +137,7 @@ def publish(config, local_repo_path):
|
|||
git.pull_from_origin(local_repo_path)
|
||||
|
||||
click.echo('Pushing your changes...')
|
||||
git.push_all(local_repo_path)
|
||||
git.push_hard(local_repo_path, config.repo_path)
|
||||
|
||||
click.echo('Compiling wiki to {}'.format(config.publish_path))
|
||||
click.confirm(WIPE_PROMPT.format(config.publish_path), abort=True)
|
||||
|
|
Loading…
Reference in New Issue