Skip to content

Commit

Permalink
bugfix, new installations couldn't create a cache
Browse files Browse the repository at this point in the history
  • Loading branch information
Frederik Delaere committed Oct 10, 2019
1 parent b2d7f2f commit b4a506e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,11 @@ pub fn update(modulepath: &str, shell: &str) -> bool {
let mut index_default: i32 = 0;

let file_str = format!("{}/{}", modulepath, MODULESINDEX);
let num_modules = count_modules_in_cache(&PathBuf::from(&file_str));
let num_modules = if Path::new(&file_str).exists() {
count_modules_in_cache(&PathBuf::from(&file_str))
} else {
0
};

if shell == "progressbar" {
echo("", shell);
Expand Down

0 comments on commit b4a506e

Please sign in to comment.