diff --git a/.gitignore b/.gitignore index b77afbf..b54d488 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,6 @@ /target **/*.rs.bk README.md.temp +GTAGS +GRTAGS +GPATH diff --git a/GPATH b/GPATH deleted file mode 100644 index d10cd0a..0000000 Binary files a/GPATH and /dev/null differ diff --git a/GRTAGS b/GRTAGS deleted file mode 100644 index 94d9f25..0000000 Binary files a/GRTAGS and /dev/null differ diff --git a/GTAGS b/GTAGS deleted file mode 100644 index 25b40c5..0000000 Binary files a/GTAGS and /dev/null differ diff --git a/src/igloo.rs b/src/igloo.rs index 4205d07..fc301c4 100644 --- a/src/igloo.rs +++ b/src/igloo.rs @@ -181,7 +181,6 @@ impl Igloo pub fn run(&self, inst_type: IglooInstType) -> Result { let mut res_err = IGLOO_ERR_NONE; - loop { match inst_type { IGLOO_NULL => res_err = IGLOO_ERR_UNKNOWN, @@ -203,7 +202,6 @@ impl Igloo // Check if the project folder already exists // Don't want to accidentally overwrite anything - let mut prj_path_buf = std::path::PathBuf::from(prj_name); if std::path::Path::new(prj_name).exists() { res_err = IGLOO_FOLDER_ALREADY_EXISTS; @@ -211,7 +209,45 @@ impl Igloo } // Create new directory - let active_dir = self.env_info.cwd.clone(); + let mut active_dir = self.env_info.cwd.clone(); + + println!("Active Directory: {:?}", active_dir.display()); + active_dir.push(prj_name); + match std::fs::create_dir(&active_dir) + { + Err(e) => println!("{:?}", e), + _ => (), + } + println!("Active Directory: {:?}", active_dir.display()); + println!("Creating .igloo dir..."); + match std::fs::create_dir(std::path::Path::new(&active_dir).join(".igloo")) + { + Err(e) => println!("{:?}", e), + _ => (), + } + match std::fs::create_dir(std::path::Path::new(&active_dir).join("src")) + { + Err(e) => println!("{:?}", e), + _ => (), + } + match std::fs::create_dir(std::path::Path::new(&active_dir).join("inc")) + { + Err(e) => println!("{:?}", e), + _ => (), + } + match std::fs::create_dir(std::path::Path::new(&active_dir).join("cfg")) + { + Err(e) => println!("{:?}", e), + _ => (), + } + println!("Displaying contents of {:?}", active_dir.display()); + for entry in active_dir.read_dir().unwrap() + { + let dir = entry.unwrap(); + println!("{:?}", dir.file_name()); + } + + } else { @@ -226,7 +262,7 @@ impl Igloo { } - _ => println!("Stufff"), + _ => println!("Unhandled case: {:?}", inst_type), } break; } if res_err == IGLOO_ERR_NONE { diff --git a/src/main.rs b/src/main.rs index 4a28081..1b49161 100644 --- a/src/main.rs +++ b/src/main.rs @@ -11,7 +11,8 @@ fn main() let ig = igloo::Igloo::New(); match ig.start() { - Ok(it) => { + Ok(it) => + { match ig.run(it) { Ok(s) => println!("{}", s),