Skip to content

Commit

Permalink
Initialize cache dir on startup. Fixes issue #5
Browse files Browse the repository at this point in the history
  • Loading branch information
dandels committed Jul 15, 2023
1 parent 47846af commit b341217
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/cache/file_lists.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ impl FileLists {
pub async fn new(config: &Config) -> Result<Self, CacheError> {
let mut file_lists: HashMap<(String, u32), FileList> = HashMap::new();

fs::create_dir_all(config.cache_dir()).await?;

// Iterates over the entries in cache_dir/file_lists/<game>/<mod_id>.json and deserializes them into FileLists
let mut stream = fs::read_dir(config.cache_dir()).await?;
while let Some(game_dir) = stream.next_entry().await? {
Expand Down

0 comments on commit b341217

Please sign in to comment.