diff options
Diffstat (limited to 'jt')
-rwxr-xr-x | jt | 21 |
1 files changed, 11 insertions, 10 deletions
@@ -84,6 +84,15 @@ class DraftsDirectory(object): return None +def commit_to_git(source_dir, pathnames): + cliapp.runcmd(['git', 'add'] + pathnames, cwd=source_dir) + cliapp.runcmd(['git', 'commit', '-m', 'Publish log entry'], cwd=source_dir) + + +def push_git(source_dir): + cliapp.runcmd(['git', 'push', 'origin', 'HEAD'], cwd=source_dir) + + class Command(object): def __init__(self, app): @@ -241,18 +250,10 @@ class FinishCommand(Command): os.rename(draft_attch, pub_attch) def _commit_to_git(self, pathnames): - cliapp.runcmd( - ['git', 'add'] + pathnames, - cwd=self._app.settings['source']) - - cliapp.runcmd( - ['git', 'commit', '-m', 'Publish log entry'], - cwd=self._app.settings['source']) + commit_to_git(self._app.settings['source'], pathnames) def _push_git(self): - cliapp.runcmd( - ['git', 'push', 'origin', 'HEAD'], - cwd=self._app.settings['source']) + push_git(self._app.settings['source']) class NewTopicCommand(Command): |