Now asks for confirmation before clearing the trash. Plus minor changes.

This commit is contained in:
= 2022-06-04 22:10:39 +05:30
parent 4812961014
commit c65600e667
2 changed files with 9 additions and 4 deletions

View File

@ -36,4 +36,4 @@ Personally, I am happy with the set of features I currently have and will work o
*This software is provided without any guarantees. Things may break any moment, your posts might get messed up. Keeping backups of your blog directories is always advised.*
# Reporting Bugs/Sending Feedback
I (try to) log in daily on the tildeverse irc. You can send a private message to me at `desertmouse` there.
I (try to) log in daily on the tildeverse IRC. You can send a private message to me at `desertmouse` there.

11
gempost
View File

@ -331,7 +331,7 @@ Available arguments:
manage - edit or delete your posts
search [search term] - Search your post headings for a search term and manage just those posts
search [search term] - Search your post titles for a search term and manage just those posts
purge - premanently delete the files in trash/
init - set up your public_gemini/ directory for gempost
@ -491,8 +491,13 @@ elif (arg == "purge"): # permanently delete trashed posts
if (len(listdir(f"{wdir}trash/")) == 0):
prYellow("Trash is already empty.")
else:
exec(f"rm {wdir}trash/*")
prGreen("Trash cleared.")
prRed("This will permanently delete your trashed posts.")
cc = input("Confirm (y/[n]): ")
if (cc == 'y' or cc == 'Y'):
exec(f"rm {wdir}trash/*")
print("\nTrash cleared.")
else:
print("\nCancelled.")
elif (arg == "init"): # initialize public_gemini/ for use with gempost
if (len(listdir(f"{wdir}")) <= 1):