From 2d1cc39d684a2284237046ba1edff981245313bb Mon Sep 17 00:00:00 2001 From: Phyks Date: Wed, 30 Jul 2014 15:30:21 +0200 Subject: [PATCH] Fix RSS + Markdown support --- pre-commit.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/pre-commit.py b/pre-commit.py index 6214c2c..9df24cb 100755 --- a/pre-commit.py +++ b/pre-commit.py @@ -640,13 +640,13 @@ for filename in deleted_files: # Delete generated files try: - os.unlink("gen/"+filename[4:-5]+".gen") + os.unlink("gen/"+filename[4:filename.rfind('.')]+".gen") os.unlink("blog/"+filename[4:]) except FileNotFoundError: print("[INFO] (DELETION) Article "+filename[4:]+" seems " "to not have already been generated. " "You should check manually.") - os.system("git rm gen/"+filename[4:-5]+".gen") + os.system("git rm gen/"+filename[4:filename.rfind('.')]+".gen") os.system("git rm blog/"+filename[4:]) print("[INFO] (DELETION) Deleted article "+filename[4:] + @@ -710,8 +710,8 @@ for filename in added_files+modified_files: article = article.replace("@article_path", article_path) try: - auto_dir("gen/"+filename[4:-5]+".gen") - with open("gen/"+filename[4:-5]+".gen", 'w') as article_file: + auto_dir("gen/"+filename[4:filename.rfind('.')]+".gen") + with open("gen/"+filename[4:filename.rfind('.')]+".gen", 'w') as article_file: article_file.write("
\n" "\t