Skip to main content

extract_cargo_target_dir

Function extract_cargo_target_dir 

Source
pub fn extract_cargo_target_dir(command: &str) -> Option<PathBuf>
Expand description

The path a rendered command sets CARGO_TARGET_DIR= to, if any.

magi never computes the cache path itself. The operator’s magi.toml is the only place that knows it, and by the time a crate::config::Config exists that template has been rendered — so the concrete path is read back out of the verify commands (CARGO_TARGET_DIR={{ vars.cache }}/magi-target cargo … becomes C:\…\Temp\magi-target). This is what lets the janitor prune exactly the directory the gate and the seats build into. None when no command sets the variable: there is then no cache to aggregate or prune, and agents build wherever the repository’s own defaults put them.

The value may be quoted with ' or "; both are understood, as is no quoting (up to the next whitespace).