update to push desktop launcher file up a directory

This commit is contained in:
OddlyTimbot 2024-09-20 14:16:16 -04:00
parent 3e64eaacbf
commit 74afad6f99

View File

@ -1,7 +1,7 @@
import os import os
import getpass 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 # Loop through all files in the specified folder
for filename in os.listdir(folder_path): for filename in os.listdir(folder_path):
if filename.endswith(".desktop"): # Only process text files 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) new_content = file_content.replace(target_word, replacement_word)
# Write the new content back to the file # Write the new content back to the file
file_path = os.path.join(dest_path, filename)
with open(file_path, 'w') as file: with open(file_path, 'w') as file:
file.write(new_content) file.write(new_content)