Skip to main content

store_rules

Function store_rules 

Source
pub fn store_rules(root: &Path, local: &str, tally: &RulesTally)
Expand description

Leave a rule tally for the entry path. Never fatal: a checkout that cannot be written still gets a preflight, just one that says the rules were not counted.

use majordomus_cli::environment::preflight::{cached_rules, store_rules, RulesTally};
let dir = tempfile::tempdir().unwrap();
store_rules(dir.path(), ".ai/local", &RulesTally { rules: 3, ..Default::default() });
assert_eq!(cached_rules(dir.path(), ".ai/local").unwrap().rules, 3);