From 5ecb486e814d500e60ec5e5f6046c42a5fa6226b Mon Sep 17 00:00:00 2001 From: Chris Xiong Date: Fri, 2 Aug 2024 01:46:34 -0400 Subject: Remove the post if it wasn't made successfully. --- utils/notectl.py | 1 + 1 file changed, 1 insertion(+) diff --git a/utils/notectl.py b/utils/notectl.py index f64a371..12e804e 100644 --- a/utils/notectl.py +++ b/utils/notectl.py @@ -39,6 +39,7 @@ def new_post(): p = postutil.process_post(postpath, False) if len(p.content) == 0 and len(p.media) == 0: print("No post was made.") + os.remove(postpath) return print(f"Post {os.path.basename(postpath)} made!") m = Monolith(os.path.join(conf.LOCAL_DATA_ROOT, "posts.monolith")) -- cgit v1.2.3