diff options
| author | Yuqian Yang <crupest@crupest.life> | 2025-11-04 21:35:33 +0800 |
|---|---|---|
| committer | Yuqian Yang <crupest@crupest.life> | 2025-11-04 21:35:33 +0800 |
| commit | 08cce61ac9e4b7ebb557b68d57097bd7eab930f3 (patch) | |
| tree | 0e97c24a9ed539fd10ffd0c5ba5af2eb179f2486 /tools/migrate-2/rename-hpp-to-h.py | |
| parent | 327f54b605b92a7b81a5a4de95f9f3741b786be5 (diff) | |
| download | cru-08cce61ac9e4b7ebb557b68d57097bd7eab930f3.tar.gz cru-08cce61ac9e4b7ebb557b68d57097bd7eab930f3.tar.bz2 cru-08cce61ac9e4b7ebb557b68d57097bd7eab930f3.zip | |
Remove unused tools.
Diffstat (limited to 'tools/migrate-2/rename-hpp-to-h.py')
| -rw-r--r-- | tools/migrate-2/rename-hpp-to-h.py | 34 |
1 files changed, 0 insertions, 34 deletions
diff --git a/tools/migrate-2/rename-hpp-to-h.py b/tools/migrate-2/rename-hpp-to-h.py deleted file mode 100644 index c72fb2e0..00000000 --- a/tools/migrate-2/rename-hpp-to-h.py +++ /dev/null @@ -1,34 +0,0 @@ -#!/usr/bin/env python3 - -import os.path - -project_root = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) - -def rename_hpp_to_h(dir): - for root, dirs, files in os.walk(dir): - for file in files: - if file.endswith(".hpp"): - os.rename(os.path.join(root, file), os.path.join(root, file[:-4] + ".h")) - -rename_hpp_to_h(os.path.join(project_root, "include")) -rename_hpp_to_h(os.path.join(project_root, "src")) -rename_hpp_to_h(os.path.join(project_root, "test")) -rename_hpp_to_h(os.path.join(project_root, "demos")) - -def replace_hpp_with_h(file): - with open(file, "r") as f: - content = f.read() - content = content.replace(".hpp", ".h") - with open(file, "w") as f: - f.write(content) - -def replace_hpp_with_h_recursive(dir): - for root, dirs, files in os.walk(dir): - for file in files: - if file.endswith(".cpp") or file.endswith(".h") or file.endswith(".mm"): - replace_hpp_with_h(os.path.join(root, file)) - -replace_hpp_with_h_recursive(os.path.join(project_root, "include")) -replace_hpp_with_h_recursive(os.path.join(project_root, "src")) -replace_hpp_with_h_recursive(os.path.join(project_root, "test")) -replace_hpp_with_h_recursive(os.path.join(project_root, "demos")) |
