Ensure the STAN workspace exists and manage output/diff subdirectories.
Behavior:
stanPath/output
stanPath/diff
stanPath/patch
keep === false
output/archive.tar
diff/archive.prev.tar
output
Repo root.
Workspace folder (e.g., .stan).
.stan
When true, do not clear the output directory.
true
Absolute path to the workspace root (stanPath).
stanPath
Ensure the STAN workspace exists and manage output/diff subdirectories.
Behavior:
stanPath/output
andstanPath/diff
exist.stanPath/patch
exists so archives can include it.keep === false
, copyoutput/archive.tar
todiff/archive.prev.tar
if present, then clear only theoutput
directory.