diff options
author | Lars Wirzenius <lars.wirzenius@codethink.co.uk> | 2013-10-14 17:17:01 +0100 |
---|---|---|
committer | Lars Wirzenius <lars.wirzenius@codethink.co.uk> | 2013-10-14 17:17:01 +0100 |
commit | b02f2e9e531246ac10db4938939e004a8c0374a9 (patch) | |
tree | 8dd127913a281148e119c95a10ce7f2b7d7b6579 | |
parent | 803e86f545bd62045a843e1f985c0a481fb23f68 (diff) | |
download | jt-b02f2e9e531246ac10db4938939e004a8c0374a9.tar.gz |
Commit and push published log entries
-rwxr-xr-x | jt | 27 |
1 files changed, 16 insertions, 11 deletions
@@ -58,6 +58,11 @@ class JournalTool(cliapp.Application): 'use journal layout (one of liw, ct)', metavar='LAYOUT') + self.settings.boolean( + ['git'], + 'add entries to git automatically', + default=True) + def cmd_new(self, args): '''Create a new journal entry draft.''' @@ -196,16 +201,16 @@ class JournalTool(cliapp.Application): if os.path.exists(draft_attch): os.rename(draft_attch, pub_attch) - # src = os.path.join(opts.base, 'src') - # argv = ['bzr', 'add', finished] - # if os.path.exists(finished_dir): - # argv.append(finished_dir) - # subprocess.check_call(argv, cwd=src) - # subprocess.check_call(['bzr', 'commit', '-m', 'new note'], cwd=src) - # subprocess.check_call(['ikiwiki', '--setup', '../ikiwiki.setup', - # '--refresh'], - # cwd=src) - - + if self.settings['git']: + argv = ['git', 'add', pub_mdwn] + if os.path.exists(pub_attch): + argv.append(pub_attch) + cliapp.runcmd(argv, cwd=self.settings['source']) + cliapp.runcmd( + ['git', 'commit', '-m', 'Publish log entry'], + cwd=self.settings['source']) + cliapp.runcmd( + ['git', 'push', 'origin', 'HEAD'], + cwd=self.settings['source']) JournalTool().run() |