Skip to content

Commit c8ab012

Browse files
committed
fix file skipping in prepare submission
1 parent 26cd33c commit c8ab012

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

tmc-langs-framework/src/io/file_util.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,7 @@ where
184184
for i in 0..archive.len() {
185185
let mut file = archive.by_index(i)?;
186186
if filter(&file) {
187+
log::debug!("skipped file {}", file.name());
187188
continue;
188189
}
189190

tmc-langs-util/src/task_executor/submission_packaging.rs

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -165,13 +165,15 @@ pub fn prepare_submission(
165165

166166
fn useless_file_filter(entry: &ZipFile) -> bool {
167167
let files_to_filter = &[
168-
".DS_Store",
169-
"desktop.ini",
170-
"Thumbs.db",
171-
".directory",
172-
"__MACOSX",
168+
std::ffi::OsStr::new(".DS_Store"),
169+
std::ffi::OsStr::new("desktop.ini"),
170+
std::ffi::OsStr::new("Thumbs.db"),
171+
std::ffi::OsStr::new(".directory"),
172+
std::ffi::OsStr::new("__MACOSX"),
173173
];
174-
files_to_filter.contains(&entry.name())
174+
Path::new(entry.name())
175+
.components()
176+
.any(|p| files_to_filter.contains(&p.as_os_str()))
175177
}
176178

177179
let temp = tempfile::tempdir().map_err(UtilError::TempDir)?;

0 commit comments

Comments
 (0)