Created
June 7, 2016 23:26
-
-
Save chasinglogic/ebe65b7f8bf9d21a7a83a5ebbfd59686 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pub fn gen_module(mut name: String, private: bool) { | |
let mut working_dir = env::current_dir().expect("Unexpected Error: Cannot get current working directory."); | |
// This makes sure that the name ends with .rs if not a directory | |
if is_file(&name) { name.push_str(".rs") } | |
for dir in name.split("/") { | |
if is_file(&dir) { | |
working_dir.push(name); | |
gen_file_module(working_dir.clone()); | |
break; | |
} | |
gen_folder_module(working_dir.clone()); | |
update_modrs(working_dir, generate_modstring(dir, private)); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment