From 74afad6f99473d89b1edc6a9c298325e99f16739 Mon Sep 17 00:00:00 2001 From: OddlyTimbot Date: Fri, 20 Sep 2024 14:16:16 -0400 Subject: [PATCH] update to push desktop launcher file up a directory --- user_updater.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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)