From 2eaacd4968861e6d238c6e585c3d8f44f4a81ef8 Mon Sep 17 00:00:00 2001 From: Joel Mathew Thomas <90510078+joelmathewthomas@users.noreply.github.com> Date: Tue, 23 Jul 2024 00:19:30 +0530 Subject: [PATCH] modified fileconv bin --- .local/bin/fileconv | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.local/bin/fileconv b/.local/bin/fileconv index 4e28e9e..9dd6a45 100755 --- a/.local/bin/fileconv +++ b/.local/bin/fileconv @@ -23,6 +23,12 @@ def rename_folders_and_files(directory): os.rename(old_path, new_path) if __name__ == "__main__": - root_directory = input("Enter the root directory path: ") - rename_folders_and_files(root_directory) + root_directory = os.getcwd() + confirmation = input(f"Are you sure you want to rename all files and folders in '{root_directory}'? (yes/no): ") + + if confirmation.lower() == 'yes': + rename_folders_and_files(root_directory) + print("Renaming completed.") + else: + print("Operation canceled.")