MCPcopy Create free account
hub / github.com/GCWing/BitFun / load

Method load

src/apps/cli/src/config.rs:146–160  ·  view source on GitHub ↗

Load configuration

()

Source from the content-addressed store, hash-verified

144
145 /// Load configuration
146 pub fn load() -> Result<Self> {
147 let config_path = Self::config_path()?;
148
149 if !config_path.exists() {
150 tracing::info!("Config file not found, using defaults");
151 let config = Self::default();
152 config.save()?;
153 return Ok(config);
154 }
155
156 let content = fs::read_to_string(&config_path)?;
157 let config: Self = toml::from_str(&content)?;
158 tracing::info!("Loaded config: {:?}", config_path);
159 Ok(config)
160 }
161
162 /// Save configuration
163 pub fn save(&self) -> Result<()> {

Callers 6

miniapp_ai_chatFunction · 0.45
get_mcp_status_textFunction · 0.45

Calls 2

existsMethod · 0.45
saveMethod · 0.45

Tested by

no test coverage detected