Skip to content

Commit

Permalink
Fix python script
Browse files Browse the repository at this point in the history
  • Loading branch information
alexandre-touret committed Feb 9, 2022
1 parent 7701c4b commit 26d7628
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions publish_drafts.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit 26d7628

Please sign in to comment.