diff options
Diffstat (limited to 'jt')
-rwxr-xr-x | jt | 29 |
1 files changed, 19 insertions, 10 deletions
@@ -175,17 +175,12 @@ class FinishCommand(Command): os.rename(draft_attch, pub_attch) if self._app.settings['git']: - argv = ['git', 'add', pub_mdwn] if os.path.exists(pub_attch): - argv.append(pub_attch) - cliapp.runcmd(argv, cwd=self._app.settings['source']) - cliapp.runcmd( - ['git', 'commit', '-m', 'Publish log entry'], - cwd=self._app.settings['source']) - if self.settings['push']: - cliapp.runcmd( - ['git', 'push', 'origin', 'HEAD'], - cwd=self._app.settings['source']) + self.commit_to_git([pub_mdwn, pub_attch]) + else: + self.commit_to_git([pub_mdwn]) + if self._app.settings['push']: + self.push_git() def published_dir(self): subdirs = { @@ -211,6 +206,20 @@ class FinishCommand(Command): return basename + def commit_to_git(self, pathnames): + cliapp.runcmd( + ['git', 'add'] + pathname, + cwd=self._app.settings['source']) + + cliapp.runcmd( + ['git', 'commit', '-m', 'Publish log entry'], + cwd=self._app.settings['source']) + + def push_git(self): + cliapp.runcmd( + ['git', 'push', 'origin', 'HEAD'], + cwd=self._app.settings['source']) + class NewPersonCommand(Command): |