From c69caeb49112ae9045d1bff1c2fbbd4af392ec1c Mon Sep 17 00:00:00 2001 From: HomunMage Date: Sun, 13 Oct 2024 06:21:45 +0800 Subject: [PATCH] use root --- .gitmodules | 5 --- OS/Docker | 2 +- OS/Windows/Powershell/README.md | 2 +- OS/Windows/VSCode/README.md | 2 +- Productivity/Converter/EPUB/README.md | 2 +- Productivity/Converter/Subtitle/README.md | 2 +- Productivity/Images/QRCode/README.md | 2 +- Productivity/Images/metadata/index.md | 2 +- Productivity/Images/svg/README.md | 2 +- Productivity/Youtube/README.md | 2 +- _layouts | 2 +- assets | 1 - test.py | 40 +++++++++++++++++++++++ 13 files changed, 50 insertions(+), 16 deletions(-) delete mode 160000 assets create mode 100644 test.py diff --git a/.gitmodules b/.gitmodules index 7fc5aae..373d976 100644 --- a/.gitmodules +++ b/.gitmodules @@ -3,11 +3,6 @@ url = https://github.com/PosetMage/Jekyll_includes.git branch = main -[submodule "assets"] - path = assets - url = https://github.com/PosetMage/jekyll_assets.git - branch = main - [submodule "_layouts"] path = _layouts url = ../homun_layouts.git diff --git a/OS/Docker b/OS/Docker index b087f57..43d87c2 160000 --- a/OS/Docker +++ b/OS/Docker @@ -1 +1 @@ -Subproject commit b087f57aa26ac43cbc7d48d6dcf51053ab3750e4 +Subproject commit 43d87c2aad29927f903c5e753116e84519290a1b diff --git a/OS/Windows/Powershell/README.md b/OS/Windows/Powershell/README.md index 2a70e72..08bc345 100644 --- a/OS/Windows/Powershell/README.md +++ b/OS/Windows/Powershell/README.md @@ -32,4 +32,4 @@ reg file: Loading content... - \ No newline at end of file + \ No newline at end of file diff --git a/OS/Windows/VSCode/README.md b/OS/Windows/VSCode/README.md index 70e2584..f77a725 100644 --- a/OS/Windows/VSCode/README.md +++ b/OS/Windows/VSCode/README.md @@ -25,4 +25,4 @@ Regedit folder: 電腦\HKEY_CLASSES_ROOT\Directory\shell\VSCode\command *
Loading content...
- + diff --git a/Productivity/Converter/EPUB/README.md b/Productivity/Converter/EPUB/README.md index e8bb6ee..fc6af2e 100644 --- a/Productivity/Converter/EPUB/README.md +++ b/Productivity/Converter/EPUB/README.md @@ -9,7 +9,7 @@ * example genbook.ps1: *
Loading content...
- + ## example code diff --git a/Productivity/Converter/Subtitle/README.md b/Productivity/Converter/Subtitle/README.md index e969926..e999034 100644 --- a/Productivity/Converter/Subtitle/README.md +++ b/Productivity/Converter/Subtitle/README.md @@ -21,4 +21,4 @@ graph TD; ``` - \ No newline at end of file + \ No newline at end of file diff --git a/Productivity/Images/QRCode/README.md b/Productivity/Images/QRCode/README.md index 60b621a..23c4f5c 100644 --- a/Productivity/Images/QRCode/README.md +++ b/Productivity/Images/QRCode/README.md @@ -1,6 +1,6 @@ # QR Code Generator - + diff --git a/Productivity/Images/metadata/index.md b/Productivity/Images/metadata/index.md index dcd7a59..e15394a 100644 --- a/Productivity/Images/metadata/index.md +++ b/Productivity/Images/metadata/index.md @@ -21,4 +21,4 @@ python embed_metadata.py input.png output.png metadata.json - + diff --git a/Productivity/Images/svg/README.md b/Productivity/Images/svg/README.md index 3abfa67..de887a6 100644 --- a/Productivity/Images/svg/README.md +++ b/Productivity/Images/svg/README.md @@ -25,4 +25,4 @@ result: ![](./concentric_circles.svg) result: ![](./labeled_triangle.svg) - + diff --git a/Productivity/Youtube/README.md b/Productivity/Youtube/README.md index 8aea901..9f1e283 100644 --- a/Productivity/Youtube/README.md +++ b/Productivity/Youtube/README.md @@ -27,4 +27,4 @@ download form url.txt - + diff --git a/_layouts b/_layouts index 4fc4ab6..525e85b 160000 --- a/_layouts +++ b/_layouts @@ -1 +1 @@ -Subproject commit 4fc4ab6914a65bdc052764b3544650ee2a7350ef +Subproject commit 525e85b26bb5d068499a943647def67f91a619ac diff --git a/assets b/assets deleted file mode 160000 index 48d6927..0000000 --- a/assets +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 48d69272ba0431468d7848ead7c25296cde39463 diff --git a/test.py b/test.py new file mode 100644 index 0000000..b483db1 --- /dev/null +++ b/test.py @@ -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 = '' + +# The string to replace it with +new_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)