Use temp dir for dry-run instead of ~/.fabro/runs to avoid clutter in fabro ps -a

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Bryan Helmkamp 2026-03-15 17:22:13 -04:00
parent 7c10e21ac9
commit 45bd49bedc
2 changed files with 25 additions and 15 deletions

View file

@ -456,11 +456,15 @@ pub async fn run_command(
// 3. Create logs directory
let run_id = args.run_id.unwrap_or_else(|| ulid::Ulid::new().to_string());
let run_dir = args.run_dir.unwrap_or_else(|| {
let base = dirs::home_dir()
.expect("could not determine home directory")
.join(".fabro")
.join("runs");
base.join(format!("{}-{}", Local::now().format("%Y%m%d"), run_id))
if args.dry_run {
std::env::temp_dir().join("fabro-dry-run").join(&run_id)
} else {
let base = dirs::home_dir()
.expect("could not determine home directory")
.join(".fabro")
.join("runs");
base.join(format!("{}-{}", Local::now().format("%Y%m%d"), run_id))
}
});
tokio::fs::create_dir_all(&run_dir).await?;
fabro_util::run_log::activate(&run_dir.join("cli.log"))
@ -1676,15 +1680,19 @@ async fn run_from_branch(
// Set up logs directory
let run_dir = args.run_dir.unwrap_or_else(|| {
let base = dirs::home_dir()
.expect("could not determine home directory")
.join(".fabro")
.join("runs");
base.join(format!(
"{}-{}",
chrono::Local::now().format("%Y%m%d"),
run_id
))
if args.dry_run {
std::env::temp_dir().join("fabro-dry-run").join(&run_id)
} else {
let base = dirs::home_dir()
.expect("could not determine home directory")
.join(".fabro")
.join("runs");
base.join(format!(
"{}-{}",
chrono::Local::now().format("%Y%m%d"),
run_id
))
}
});
tokio::fs::create_dir_all(&run_dir).await?;
fabro_util::run_log::activate(&run_dir.join("cli.log"))

View file

@ -12,7 +12,8 @@ PARALLEL="${PARALLEL:-1}"
[[ "$VERBOSE" == "1" ]] && PARALLEL=1
RESULTS_DIR="$(mktemp -d)"
trap 'rm -rf "$RESULTS_DIR"' EXIT
RUNS_DIR="$(mktemp -d)"
trap 'rm -rf "$RESULTS_DIR" "$RUNS_DIR"' EXIT
# Capture command output to log file; when VERBOSE=1, also stream to terminal.
capture() {
@ -77,6 +78,7 @@ run_one() {
local flags=(--auto-approve)
[[ "$PHASE" == "dry-run" ]] && flags+=(--dry-run)
[[ "$PHASE" == "haiku" ]] && flags+=(--model claude-haiku-4-5)
[[ "$PHASE" != "dry-run" ]] && flags+=(--run-dir "$RUNS_DIR/$(echo "$rel" | tr '/' '_')")
if (cd "$dot_dir" && capture "$result_file.log" "$ARC" run start "$target" "${flags[@]}"); then
echo "PASS" > "$result_file"