Skip to main content

carriers

Function carriers 

Source
pub fn carriers(root: &Path) -> Vec<Carrier>
Expand description

Every version written down by hand under CARRIER_ROOTS.

The files git would commit there — tracked, or new and not ignored, so a file is refused before it is staged rather than after — or, where this is not a git checkout, every file under those directories, so that a tree nobody committed is still read rather than passed. PROJECTION is not a statement by hand, and neither is any path the generated artifact manifest names: majordomus generate wrote those, and generate --check is what holds them.

use majordomus_cli::release::version::carriers;
let dir = tempfile::tempdir().unwrap();
std::fs::create_dir_all(dir.path().join("lib")).unwrap();
std::fs::write(dir.path().join("lib/x.sh"), "FOO_VERSION=\"1.2.3\"\n").unwrap();
let found = carriers(dir.path());
assert_eq!(found.len(), 1);
assert_eq!((found[0].path.as_str(), found[0].line), ("lib/x.sh", 1));