assay-cli 3.7.0

CLI for Assay
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use std::io;
use std::path::PathBuf;

/// Ensures the `.assay/traces` directory exists in the current working directory.
/// Returns the path to the trace directory.
pub fn ensure_assay_trace_dir() -> io::Result<PathBuf> {
    let cwd = std::env::current_dir()?;
    let trace_dir = cwd.join(".assay").join("traces");

    if !trace_dir.exists() {
        std::fs::create_dir_all(&trace_dir)?;
    }

    Ok(trace_dir)
}