diff options
| author | 2026-02-27 23:52:28 -0500 | |
|---|---|---|
| committer | 2026-02-27 23:52:28 -0500 | |
| commit | 0c70155f2c30fa84802f6dc9b893716878437295 (patch) | |
| tree | e8950e9e6dc7a47ac8a5b909e9a54be10a5afccc /src/config.rs | |
| parent | upgrade function added (diff) | |
added show command
Diffstat (limited to 'src/config.rs')
| -rw-r--r-- | src/config.rs | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/config.rs b/src/config.rs index 8e3437c..bb21f09 100644 --- a/src/config.rs +++ b/src/config.rs @@ -43,6 +43,33 @@ impl Config { let config: Config = toml::from_str(&contents).expect("failed to parse config"); Some(config) } + + pub fn log_config(self) { + if let Some(update) = &self.update { + println!("update: {}", update); + } + + if let Some(deps) = &self.dependencies { + println!("dependencies: {:?}", deps); + } + + if let Some(hooks) = &self.hooks { + println!("hooks:"); + + for (name, value) in [ + ("build", &hooks.build), + ("install", &hooks.install), + ("uninstall", &hooks.uninstall), + ("post_install", &hooks.post_install), + ("post_uninstall", &hooks.post_uninstall), + ("clean", &hooks.clean), + ] { + if let Some(val) = value { + println!(" {}: {}", name, val); + } + } + } + } } pub fn create_config(package: &str) -> Result<(), String> { |
