fix: 修正 pyarmor_runtime 目录位置到 scripts 内部
- 修改 build.py 中混淆后文件移动逻辑,先移动 scripts 目录,再将 pyarmor_runtime 移动到 scripts 内部 - 更新 spec.md 中关于混淆后文件结构的描述 - 更新 config.yaml 中测试规范,强调严禁跳过测试 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
20
build.py
20
build.py
@@ -263,16 +263,32 @@ def obfuscate_scripts_dir(source_dir: str, target_dir: str) -> None:
|
||||
sys.exit(1)
|
||||
|
||||
# 移动混淆后的文件到最终位置
|
||||
scripts_dst_dir = os.path.join(target_dir, "scripts")
|
||||
pyarmor_runtime_dir = None
|
||||
|
||||
# 先移动 scripts 目录
|
||||
for item in os.listdir(temp_dir):
|
||||
src = os.path.join(temp_dir, item)
|
||||
dst = os.path.join(target_dir, item)
|
||||
if item == "scripts":
|
||||
dst = os.path.join(target_dir, item)
|
||||
if os.path.exists(dst):
|
||||
if os.path.isdir(dst):
|
||||
shutil.rmtree(dst)
|
||||
else:
|
||||
os.remove(dst)
|
||||
shutil.move(src, dst)
|
||||
elif item.startswith("pyarmor_runtime"):
|
||||
pyarmor_runtime_dir = item
|
||||
|
||||
# 再移动 pyarmor_runtime 到 scripts 内部
|
||||
if pyarmor_runtime_dir:
|
||||
src = os.path.join(temp_dir, pyarmor_runtime_dir)
|
||||
dst = os.path.join(scripts_dst_dir, pyarmor_runtime_dir)
|
||||
if os.path.exists(dst):
|
||||
if os.path.isdir(dst):
|
||||
shutil.rmtree(dst)
|
||||
else:
|
||||
os.remove(dst)
|
||||
|
||||
shutil.move(src, dst)
|
||||
|
||||
# 清理临时目录
|
||||
|
||||
Reference in New Issue
Block a user