lib/
config.rs

1use std::fs;
2use std::path::Path;
3
4use crate::types::ResultAnyError;
5use phab_lib::client::config::PhabricatorClientConfig;
6
7pub fn parse_from_setting_path(
8  setting_path: impl AsRef<Path>,
9) -> ResultAnyError<PhabricatorClientConfig> {
10  let file_content = fs::read_to_string(&setting_path)?;
11
12  let configuration: PhabricatorClientConfig = deser_hjson::from_str(&file_content)?;
13
14  return Ok(configuration);
15}