pub fn parse_projection(text: &str) -> Option<String>Expand description
The version PROJECTION states: its first version= line, past the # banner.
Exactly what bin/majordomus reads at start-up, so the executable and the shell tool
cannot disagree about what the file says.
use majordomus_cli::release::version::parse_projection;
let file = "# GENERATED FILE — DO NOT EDIT DIRECTLY\n# Generator: majordomus-cli 0.9.0\nversion=0.9.0\n";
assert_eq!(parse_projection(file).as_deref(), Some("0.9.0"));
// a file that states nothing states no version, and an empty value is not one
assert_eq!(parse_projection("# nothing here\n"), None);
assert_eq!(parse_projection("version=\n"), None);