diff options
author | Guillaume Seguin <guillaume@segu.in> | 2010-07-21 18:44:05 -0400 |
---|---|---|
committer | Guillaume Seguin <guillaume@segu.in> | 2010-07-21 18:44:05 -0400 |
commit | 385bec0342ecc29b0bec5481edff41ad83090dc4 (patch) | |
tree | fa468daeeb21d3cd4ea0373e374e9ed9086e8e6d | |
parent | 3d3f562ef819c40bb5a08499529f45eecd3e5fb4 (diff) | |
download | blogit-385bec0342ecc29b0bec5481edff41ad83090dc4.tar.gz blogit-385bec0342ecc29b0bec5481edff41ad83090dc4.tar.bz2 |
Remove the need for the token file by using --allow-empty
-rw-r--r-- | raw_post | 9 |
1 files changed, 2 insertions, 7 deletions
@@ -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" |