Skip to main content

Module place

Module place 

Source
Expand description

Where installed skills and agents go: a canonical copy in the first configured folder, relative links to it from the others, and the .gitignore block that keeps them out of git.

Functions§

place
Copies the folder or file source to <folders[0]>/<name>, then links <folder>/<name> in each other folder to that copy, copying it where a link cannot be made. What is at those paths is replaced, so the caller must own them. Returns the placed paths, the canonical copy first.
place_with
place, making each link with link(target, path), where target is relative to the link’s folder.
unplace
Removes paths, links themselves rather than what they point to, and nothing else. Refuses, before removing anything, a path outside root as place judges it, or one whose last part is not a valid entry name.
write_ignore
Rewrites the block of manifest manifest (a file name such as chest.toml) in root/.gitignore to list entries, sorted. The block runs from # BEGIN chest (<manifest>) to # END chest, and every line outside it stays as it was. With no entries the block goes.