Reorganize drivers and utility modules into lib/ subdirectory and update server and upload scripts

This commit is contained in:
Adolfo Reyna
2026-06-17 22:22:02 -04:00
parent 2813c11104
commit 75475723fa
16 changed files with 31 additions and 14 deletions
+12
View File
@@ -510,6 +510,18 @@ class MCPServer:
elif name == "write_file":
path = str(args.get("path"))
content = str(args.get("content"))
# Auto-create parent directories on the device if present in the path
import os
parts = path.split('/')
if len(parts) > 1:
dir_path = ""
for part in parts[:-1]:
if part:
dir_path = dir_path + "/" + part if dir_path else part
try:
os.mkdir(dir_path)
except OSError:
pass # Directory likely already exists
with open(path, 'w') as f:
f.write(content)
return f"Successfully wrote {len(content)} characters to '{path}'."