fix: chmod DESCRIPTION.md before overwrite in Nix sandbox

copytree makes files read-only in Nix sandbox; rglob("DESCRIPTION.md")
then tries to overwrite skill-level copies → PermissionError. chmod
0o644 before copy2 to handle already-existing read-only targets.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Rasyidan Akbar F. 2026-03-22 02:00:02 +07:00
commit 59bd0a0547

View file

@ -127,6 +127,8 @@ let
continue
target = out / rel
target.parent.mkdir(parents=True, exist_ok=True)
if target.exists():
target.chmod(0o644)
shutil.copy2(desc, target)
for rel_str in optional_skills:
@ -148,6 +150,8 @@ let
if desc_src.exists():
desc_dst = out / rel.parts[0] / "DESCRIPTION.md"
desc_dst.parent.mkdir(parents=True, exist_ok=True)
if desc_dst.exists():
desc_dst.chmod(0o644)
shutil.copy2(desc_src, desc_dst)
for spec in custom_skills: