fix: delete old Deno 1.x headers file when loading cache (#25283)

This commit is contained in:
David Sherret 2024-08-28 19:47:15 -04:00 committed by GitHub
parent 37501aa323
commit 3afa3db4d3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 10 additions and 6 deletions

4
cli/cache/mod.rs vendored
View file

@ -74,6 +74,10 @@ impl deno_cache_dir::DenoCacheEnv for RealDenoCacheEnv {
atomic_write_file_with_retries(path, bytes, CACHE_PERM)
}
fn remove_file(&self, path: &Path) -> std::io::Result<()> {
std::fs::remove_file(path)
}
fn modified(&self, path: &Path) -> std::io::Result<Option<SystemTime>> {
match std::fs::metadata(path) {
Ok(metadata) => Ok(Some(