forked from kimhyungsik/ax_hub_mcp_tool
이모지 py 파일 삭제
This commit is contained in:
@@ -1,34 +0,0 @@
|
||||
import os
|
||||
import re
|
||||
|
||||
pattern = re.compile(r'[\u2600-\u27BF\U0001F000-\U0001F9FF]+')
|
||||
|
||||
root_dir = "."
|
||||
target_exts = {'.java', '.html', '.md', '.yml', '.properties', '.xml', '.json', '.js', '.css'}
|
||||
|
||||
count = 0
|
||||
for subdir, dirs, files in os.walk(root_dir):
|
||||
if '.git' in dirs: dirs.remove('.git')
|
||||
if 'build' in dirs: dirs.remove('build')
|
||||
if '.gradle' in dirs: dirs.remove('.gradle')
|
||||
|
||||
for file in files:
|
||||
ext = os.path.splitext(file)[1].lower()
|
||||
if ext in target_exts:
|
||||
filepath = os.path.join(subdir, file)
|
||||
try:
|
||||
with open(filepath, 'r', encoding='utf-8') as f:
|
||||
content = f.read()
|
||||
|
||||
new_content = pattern.sub('', content)
|
||||
new_content = new_content.replace('\uFE0F', '').replace('\u200D', '')
|
||||
|
||||
if new_content != content:
|
||||
with open(filepath, 'w', encoding='utf-8') as f:
|
||||
f.write(new_content)
|
||||
print(f"Cleaned: {filepath}")
|
||||
count += 1
|
||||
except Exception as e:
|
||||
pass
|
||||
|
||||
print(f"\nTotal files cleaned: {count}")
|
||||
Reference in New Issue
Block a user