feat: WIP setup actions

Signed-off-by: kjuulh <contact@kjuulh.io>
This commit is contained in:
2024-10-24 22:59:27 +02:00
parent dfa70b3485
commit db49af5fa2
16 changed files with 815 additions and 11 deletions

View File

@@ -73,3 +73,18 @@ impl From<&toml::Value> for Value {
}
}
}
impl Value {
pub fn get(&self, path: &[&str]) -> Option<&Value> {
match path.split_first() {
Some((current, rest)) => match self {
Value::Map(map) => match map.get(&current.to_string()) {
Some(value) => value.get(rest),
None => None,
},
_ => None,
},
None => Some(self),
}
}
}