code-server-liek

This commit is contained in:
Cai
2025-09-17 07:46:38 +00:00
parent 50a570eccf
commit 025c8c1a20
12 changed files with 797 additions and 1511 deletions

View File

@@ -16,7 +16,7 @@ def sudo_open(file_path, mode='r', encoding='utf-8'):
if result.returncode != 0:
raise PermissionError(f"无法读取文件: {file_path}")
content = result.stdout
yield content
return content
elif mode == 'w':
raise PermissionError(f"不允许以sudo权限写入文件: {file_path}")
else: