summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuillaume Seguin <guillaume@segu.in>2010-07-21 18:44:05 -0400
committerGuillaume Seguin <guillaume@segu.in>2010-07-21 18:44:05 -0400
commit385bec0342ecc29b0bec5481edff41ad83090dc4 (patch)
treefa468daeeb21d3cd4ea0373e374e9ed9086e8e6d
parent3d3f562ef819c40bb5a08499529f45eecd3e5fb4 (diff)
downloadblogit-385bec0342ecc29b0bec5481edff41ad83090dc4.tar.gz
blogit-385bec0342ecc29b0bec5481edff41ad83090dc4.tar.bz2
Remove the need for the token file by using --allow-empty
-rw-r--r--raw_post9
1 files changed, 2 insertions, 7 deletions
diff --git a/raw_post b/raw_post
index 641a1a4..edaf222 100644
--- a/raw_post
+++ b/raw_post
@@ -49,13 +49,8 @@ else:
print "A problem occured while editing the contents file"
raise SystemExit
-token_path = os.path.join (repo, "token")
-token = int (open (token_path).read ()) if os.path.exists (token_path) else 0
-open (token_path, "w").write (str (token + 1))
-
-subprocess.call (["git", "add", token_path])
-
-p = subprocess.Popen (["git", "commit", "-F", "-"], stdin = subprocess.PIPE)
+p = subprocess.Popen (["git", "commit", "--allow-empty", "-F", "-"],
+ stdin = subprocess.PIPE)
p.communicate ("%s\n\n%s" % (title, contents))
if p.returncode == 0: print "New post successfully added"