-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
50 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule Docker
updated
6 files
+1 −1 | HTTPS/README.md | |
+1 −1 | MediaTool/README.md | |
+1 −1 | RemoteUbuntu/README.md | |
+1 −1 | SFTP-restrict/README.md | |
+1 −1 | Scheduler/README.md | |
+1 −1 | nv-docker/README.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule assets
deleted from
48d692
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import os | ||
|
||
# Define the directory to start the recursive search (you can change this to your specific directory) | ||
root_dir = "." | ||
|
||
# The string to search for | ||
old_script = '<script src="{{ \'/assets/js/LoadAsCodeSession.js\' | relative_url }}"></script>' | ||
|
||
# The string to replace it with | ||
new_script = '<script src="https://posetmage.com/assets/js/LoadAsCodeSession.js"></script>' | ||
|
||
def replace_in_file(file_path): | ||
"""Replaces occurrences of old_script with new_script in the given file.""" | ||
try: | ||
with open(file_path, 'r', encoding='utf-8') as file: | ||
content = file.read() | ||
|
||
# Only replace if the old_script is found in the content | ||
if old_script in content: | ||
new_content = content.replace(old_script, new_script) | ||
|
||
# Write the modified content back to the file | ||
with open(file_path, 'w', encoding='utf-8') as file: | ||
file.write(new_content) | ||
print(f"Updated: {file_path}") | ||
else: | ||
print(f"No changes in: {file_path}") | ||
|
||
except Exception as e: | ||
print(f"Error processing file {file_path}: {e}") | ||
|
||
def replace_in_files_recursively(directory): | ||
"""Recursively traverses the directory and replaces old_script in all files.""" | ||
for dirpath, _, filenames in os.walk(directory): | ||
for filename in filenames: | ||
file_path = os.path.join(dirpath, filename) | ||
replace_in_file(file_path) | ||
|
||
# Start the replacement process | ||
replace_in_files_recursively(root_dir) |