Dont use .ucg directory if we cant create it

This commit is contained in:
Jeremy Wall 2021-03-10 20:07:07 -05:00
parent f35f1be851
commit 04a97a7002

View File

@ -489,10 +489,13 @@ fn main() {
if !p.exists() { if !p.exists() {
if let Err(e) = std::fs::create_dir(&p) { if let Err(e) = std::fs::create_dir(&p) {
eprintln!("Unable to create .ucg directory {}", e); eprintln!("Unable to create .ucg directory {}", e);
} } else {
}
import_paths.push(p); import_paths.push(p);
} }
} else {
import_paths.push(p);
}
}
if let Ok(path_list_str) = std::env::var("UCG_IMPORT_PATH") { if let Ok(path_list_str) = std::env::var("UCG_IMPORT_PATH") {
for p in std::env::split_paths(&path_list_str) { for p in std::env::split_paths(&path_list_str) {
import_paths.push(p); import_paths.push(p);