fix(cli): resolve a relative paths.data against the project root
Env::data_path() handed paths.data to the data layer verbatim, so a relative value resolved against the invoking process's cwd — aura run from a project subdirectory silently read a different archive location than from the root, while runs/ stayed anchored. Relative values now join onto the project root, matching runs_root() and the [nodes] pointer resolution; absolute values and the no-project default pass through unchanged. RED-first unit test pins the root-anchored resolution. closes #254
This commit is contained in:
@@ -69,8 +69,9 @@ fn mint_tempdir() -> PathBuf {
|
||||
/// Writes the `Aura.toml` + `demo_signal.json` common to every fresh project:
|
||||
/// an absolute `[nodes]` pointer at the shared, once-built fixture crate, and
|
||||
/// — when `data_dir` is `Some` — a `[paths] data` override pointing at it
|
||||
/// (relative, resolved against the invocation cwd, which every test that uses
|
||||
/// this always sets to `root` itself via `.current_dir`).
|
||||
/// (relative, resolved against the project root — `root` itself — since
|
||||
/// `Env::data_path` joins a relative `paths.data` onto the project root,
|
||||
/// same as `runs_root()` and the `[nodes]` pointers, #254).
|
||||
fn write_project_files(root: &Path, data_dir: Option<&str>) {
|
||||
let fixture = built_project();
|
||||
let data_line = data_dir.map(|d| format!("data = \"{d}\"\n")).unwrap_or_default();
|
||||
|
||||
Reference in New Issue
Block a user