Expand description
Deletes inside the working tree that lose no work: a build output
directory, a scratch directory at the top of the tree, or a find
cleanup of files a tool writes again. The static guard allows these, as
ljos-policyd does, so a stock seat with no rules of its own does not
stop rm -rf target/ or find . -name '*.pyc' -delete. The lists and
the reading are the ones in ljos-policyd’s src/lib.rs; keep the two in
step.
Functions§
- build_
output - A plain relative path inside a build output directory, or the
directory itself:
target/,./build,web/node_modules. A path through.gitis not one. - leaves_
tree - A
cd,pushdorpopdthat can leave the working tree: an absolute target,~,-,.., a variable, or none at all (home).wordsis one command, wrappers already stripped. - regenerable_
cleanup - A
findcleanup inside the working tree: every starting point is.or a plain relative path outside.git, and every name test names a file in [REGENERABLE_NAMES], with at least one. An-o, a!, a-notor a group can turn a name test around, so none passes.find . -deletehas no name test andfind . -name '*.rs' -deletenames source, so both stay refused. - scratch
- A plain relative path under a scratch directory at the top of the tree,
or the directory itself:
tmp/,./tmp/test-output. A scratch name deeper down (src/tmp) says nothing about what the path holds.