diff --git a/user_updater.py b/user_updater.py index 9aec3b1..62c2405 100644 --- a/user_updater.py +++ b/user_updater.py @@ -1,7 +1,7 @@ import os import getpass -def replace_word_in_files(target_word, replacement_word, folder_path="."): +def replace_word_in_files(target_word, replacement_word, folder_path=".", dest_path=".."): # Loop through all files in the specified folder for filename in os.listdir(folder_path): if filename.endswith(".desktop"): # Only process text files @@ -13,6 +13,7 @@ def replace_word_in_files(target_word, replacement_word, folder_path="."): new_content = file_content.replace(target_word, replacement_word) # Write the new content back to the file + file_path = os.path.join(dest_path, filename) with open(file_path, 'w') as file: file.write(new_content)