mirror of
https://github.com/jrnl-org/jrnl.git
synced 2025-05-10 16:48:31 +02:00
Git integration complete
Ready to be made better Fixes maebert/jrnl#35 Signed-off-by: Aniket Pant <me@aniketpant.com>
This commit is contained in:
parent
021ff9fb38
commit
0de0c28ea8
1 changed files with 7 additions and 0 deletions
|
@ -3,6 +3,7 @@
|
||||||
|
|
||||||
from Entry import Entry
|
from Entry import Entry
|
||||||
import exporters
|
import exporters
|
||||||
|
import subprocess
|
||||||
import os
|
import os
|
||||||
import parsedatetime.parsedatetime as pdt
|
import parsedatetime.parsedatetime as pdt
|
||||||
import re
|
import re
|
||||||
|
@ -284,6 +285,12 @@ class Journal(object):
|
||||||
exporters.to_txt(self, self.config['sync_folder'] + "journal.txt")
|
exporters.to_txt(self, self.config['sync_folder'] + "journal.txt")
|
||||||
elif arg == "files":
|
elif arg == "files":
|
||||||
exporters.to_files(self, self.config['sync_folder'] + "*.txt")
|
exporters.to_files(self, self.config['sync_folder'] + "*.txt")
|
||||||
|
os.chdir(self.config['sync_folder'])
|
||||||
|
subprocess.call(["git", "pull"])
|
||||||
|
subprocess.call(["git", "add", "."])
|
||||||
|
message = "Site update at " + str(datetime.now().strftime('%Y-%m-%d %H:%M:%S'))
|
||||||
|
subprocess.call(["git", "commit", "-m", message])
|
||||||
|
subprocess.call(["git", "push"])
|
||||||
return "journal synced to " + self.config['sync_folder']
|
return "journal synced to " + self.config['sync_folder']
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue