From aba453b5718ef80840aa8382abf60d6e69778f95 Mon Sep 17 00:00:00 2001 From: Ian Wijma Date: Wed, 3 Apr 2024 23:29:33 +1100 Subject: [PATCH] Remove printers --- Cargo.toml | 5 ++++- src/commands/run.rs | 25 ++++++++++++++++++++++++- 2 files changed, 28 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index dac7f64..b29fda2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,8 +11,11 @@ glob = "0.3.1" serde = { version = "1.0.197", features = ["derive"] } serde_yaml = "0.9.34" +[profile.dev] +opt-level = 0 + [profile.release] strip = true # Automatically strip symbols from the binary. opt-level = "z" # Optimize for size. lto = true -codegen-units = 1 +codegen-units = 1 \ No newline at end of file diff --git a/src/commands/run.rs b/src/commands/run.rs index 6563ec2..8fa0d57 100644 --- a/src/commands/run.rs +++ b/src/commands/run.rs @@ -32,7 +32,8 @@ pub fn run (arguments: &Arguments) -> Result<(), String> { // Resolve dependencies based on the directory structure // (In the future this will be configurable based on a dependency config field) - // let config_structure: ConfigStructure = resolve_config_structure(configs); + let config_structure: ConfigStructure = resolve_config_structure(configs)?; + println!("config_structure: {:?}", config_structure); // Gather the tasks from the config // let task_structure: TaskStructure = resolve_task_structure(config_structure, task_name); @@ -45,6 +46,28 @@ pub fn run (arguments: &Arguments) -> Result<(), String> { Ok(()) } +#[derive(Debug, Clone)] +struct ConfigStructure { + config: Config, + child: HashMap +} + +fn resolve_config_structure(_configs: Vec) -> Result { + let _path_map: HashMap = HashMap::new(); + + // TODO: Create a recursive method that creates the config structure based on the directories. + let config_structure = ConfigStructure { + config: Config{ + name: "".to_string(), + tasks: Default::default(), + path: Default::default(), + }, + child: HashMap::new() + }; + + Ok(config_structure) +} + #[derive(Debug, Clone)] enum TaskType { SHELL