Skip to main content

append

Function append 

Source
pub fn append(root: &Path, obs: &Observation) -> Result<PathBuf>
Expand description

Appends obs to the checkout’s observation file, creating it. The file is checkout-local and never tracked, so a record of a deployment cannot end up describing the tree it is committed into.

use majordomus_cli::served::{append, observe, read_all, Ancestry, Fetch, Fetched};
use std::time::SystemTime;
let dir = tempfile::tempdir().unwrap();
let o = observe("pages", "https://s", "build.json", &"a".repeat(40), &N, &A,
                SystemTime::UNIX_EPOCH);
append(dir.path(), &o).unwrap();
assert_eq!(read_all(dir.path()).0, vec![o]);