add an API in ConfigBuilder to point to config file for toml parsing

This commit is contained in:
bit-aloo 2025-09-16 21:16:29 +05:30
parent a12969e0d1
commit 6c79f547f9
No known key found for this signature in database

View file

@ -98,6 +98,14 @@ impl ConfigBuilder {
self
}
pub fn config_toml(mut self, config_toml: &str) -> Self {
let toml_path = self.directory.join("bootstrap.toml");
std::fs::write(&toml_path, config_toml).unwrap();
self.args.push("--config".to_string());
self.args.push(toml_path.display().to_string());
self
}
pub fn create_config(mut self) -> Config {
// Run in dry-check, otherwise the test would be too slow
self.args.push("--dry-run".to_string());