From 26d7628228570f7cf92685ab4c5988b83cead4df Mon Sep 17 00:00:00 2001 From: Alexandre Touret Date: Wed, 9 Feb 2022 12:23:07 +0100 Subject: [PATCH] Fix python script --- publish_drafts.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/publish_drafts.py b/publish_drafts.py index e3ea58134..9e328e89e 100644 --- a/publish_drafts.py +++ b/publish_drafts.py @@ -13,13 +13,13 @@ def publishFile(file): # Only publish if the date specified in the file is older than now() if(datetime_object < datetime.now()): basename=os.path.basename(file) - dest=POSTS_FOLDER+"/"+datetime_object.strftime("%Y-%m-%-d")+"-"+basename + dest=POSTS_FOLDER+"/"+datetime_object.strftime("%Y-%m-%d")+"-"+basename print("Copying draft [",file,"] to [",dest,"]") shutil.copy(file,dest) - shutil.remove(file) + os.remove(file) print("Draft published") else: - print("This file [",file,"] is newer than now") + print("This file [",file,":(",datetime_object,")] is newer than now") def main(): for file in glob.glob(DRAFTS_FOLDER+"/*.md", recursive = False):