From 71d4fb91d7144bd8dfae44bcfd0d20ebb84cf063 Mon Sep 17 00:00:00 2001 From: Rekai Musuka Date: Mon, 1 Mar 2021 21:23:09 -0600 Subject: [PATCH] fix: ignore subdirs when walking through dirs This fixes a bug where save-sync track would never work because we would try to interpret a directory as a file (which held some data we would then try to read) --- client/src/archive.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/client/src/archive.rs b/client/src/archive.rs index 143773a..147119b 100644 --- a/client/src/archive.rs +++ b/client/src/archive.rs @@ -109,8 +109,13 @@ impl Archive { for maybe_entry in WalkDir::new(path) { match maybe_entry { Ok(entry) => { - let game_file = GameFile::new(entry.path())?; - game_files.push(game_file); + if entry.path().is_file() { + let game_file = GameFile::new(entry.path())?; + game_files.push(game_file); + } + + // FIXME: WalkDir will also return the paths of files. DO we want to track these? + // if so, how will be do that? } Err(err) => { let io_err: std::io::Error = err.into();