mirror of
https://github.com/0xrsydn/nix-hermes-agent.git
synced 2026-08-07 00:53:52 +00:00
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:
parent
880796fc0e
commit
59bd0a0547
1 changed files with 4 additions and 0 deletions
|
|
@ -127,6 +127,8 @@ let
|
||||||
continue
|
continue
|
||||||
target = out / rel
|
target = out / rel
|
||||||
target.parent.mkdir(parents=True, exist_ok=True)
|
target.parent.mkdir(parents=True, exist_ok=True)
|
||||||
|
if target.exists():
|
||||||
|
target.chmod(0o644)
|
||||||
shutil.copy2(desc, target)
|
shutil.copy2(desc, target)
|
||||||
|
|
||||||
for rel_str in optional_skills:
|
for rel_str in optional_skills:
|
||||||
|
|
@ -148,6 +150,8 @@ let
|
||||||
if desc_src.exists():
|
if desc_src.exists():
|
||||||
desc_dst = out / rel.parts[0] / "DESCRIPTION.md"
|
desc_dst = out / rel.parts[0] / "DESCRIPTION.md"
|
||||||
desc_dst.parent.mkdir(parents=True, exist_ok=True)
|
desc_dst.parent.mkdir(parents=True, exist_ok=True)
|
||||||
|
if desc_dst.exists():
|
||||||
|
desc_dst.chmod(0o644)
|
||||||
shutil.copy2(desc_src, desc_dst)
|
shutil.copy2(desc_src, desc_dst)
|
||||||
|
|
||||||
for spec in custom_skills:
|
for spec in custom_skills:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue