diff --git a/GPATH b/GPATH index 1b37f1f..d10cd0a 100644 Binary files a/GPATH and b/GPATH differ diff --git a/src/igloo.rs b/src/igloo.rs index 3405c00..552769e 100644 --- a/src/igloo.rs +++ b/src/igloo.rs @@ -4,6 +4,7 @@ use std::vec::Vec; use std::string::String; use std::collections::HashMap; use config::*; +use std::error::Error; use clap::{Arg, App}; enum BuildType @@ -11,16 +12,24 @@ enum BuildType Release, Debug, } -// used for managing existing igloo projects -// Igloo Project Manager - A struct for holding all -// information pertaining to the current Igloo Project -// An igloo project uses the .igloo folder to maintain -// knowledge of its existence. pub struct ProjectManager { - + makeManifest: MakeManifest, + mcuManifest: McuManifest, } +impl ProjectManager +{ + pub fn get_config() -> Self + { + let mut conf = Config::default(); + ProjectManager + { + makeManifest: MakeManifest::from_config(&mut conf), + mcuManifest: McuManifest::from_config(&mut conf), + } + } +} // used for managing cli requests for new and existing igloo projects pub struct CliManager<'b> { @@ -28,33 +37,32 @@ pub struct CliManager<'b> debug_mode: bool, release_mode: bool, fresh_mode: bool, - version: String, - name: String, + version: &'b str, + name: &'b str, author: &'b str, description: &'b str, } impl<'b> CliManager<'b> { - pub fn new(this: &'b Self) -> Self + pub fn new() -> Self { - let _version = "v".to_owned() + crate_version!(); CliManager { - version: _version.to_owned(), - name: crate_name!().to_owned(), + version: concat!("v", crate_version!()), + name: crate_name!(), author: crate_authors!(), description: crate_description!(), debug_mode: true, release_mode: false, fresh_mode: false, - app: clap::App::new(this.name) - .author(this.author) - .version(&*this.version) - .about(this.description), - + app: clap::App::new(crate_name!()) + .author(crate_authors!()) + .version(concat!("v", crate_version!())), } } + + } // Make Manifest contains default flags, files, and // include directories. User files, flags, and directories diff --git a/src/main.rs b/src/main.rs index 7d4aa00..a6b1ae9 100644 --- a/src/main.rs +++ b/src/main.rs @@ -6,6 +6,8 @@ fn main() { println!("Hi"); let _igloo = igloo::CliManager::new(); + let pm = igloo::ProjectManager::get_config(); + // let mut _igloo: Igloo = Igloo // { // debug_mode: true,