fresh-cat-90827
03/14/2023, 7:11 PMfoo/bar/
created and non-empty, with my digests being foo/bar/file1.txt
and foo/bar/file2.txt
I want to ensure the foo/bar
won't have anything else after the write (essentially truncating the directory first). Is that possible at all?fast-nail-55400
03/14/2023, 7:19 PMfresh-cat-90827
03/14/2023, 7:21 PMdir_digest = await Get(Digest, CreateDigest([Directory(f"foo/bar")]))
workspace.write_digest(dir_digest)
before creating files (hoping it would overwrite the existing directory with an empty one), but that didn't work.
The goal rule can perform side effects so just delete the directory first with normal Python code?Thanks, that's an option I have, I guess. It would be nice to be able to do this from Pants to avoid mixing Pants and non-Pants operations
curved-television-6568
03/14/2023, 7:27 PMworkspace.write_digest()
?fresh-cat-90827
03/21/2023, 5:07 PM