22 lines
802 B
Python
22 lines
802 B
Python
import os
|
|
import json
|
|
|
|
boards_dir = r"D:\DE-MIXLY\mixly3-server\mixly\boards"
|
|
|
|
for root, dirs, files in os.walk(boards_dir):
|
|
for file in files:
|
|
if file == "config.json":
|
|
file_path = os.path.join(root, file)
|
|
try:
|
|
with open(file_path, "r", encoding="utf-8") as f:
|
|
content = f.read()
|
|
|
|
new_content = content.replace('\\"{esptool}\\"', '{esptool}').replace('\\"{ampy}\\"', '{ampy}')
|
|
|
|
if content != new_content:
|
|
print(f"Fixing: {file_path}")
|
|
with open(file_path, "w", encoding="utf-8") as f:
|
|
f.write(new_content)
|
|
except Exception as e:
|
|
print(f"Error processing {file_path}: {e}")
|