1
0
mirror of https://github.com/bobwen-dev/hunter synced 2025-04-12 00:55:41 +02:00

check if /tmp/hunter-previews exists before deleting

This commit is contained in:
rabite 2019-07-25 21:29:10 +02:00
parent 8cb02c59be
commit 3b80c3b20f

View File

@ -375,9 +375,11 @@ impl Previewer {
{
kill_proc().log();
// Delete files left by graphical PDF previews, etc.
std::fs::remove_dir_all("/tmp/hunter-previews/")
.map_err(HError::from)
.log();
if std::path::Path::new("/tmp/hunter-previews").exists() {
std::fs::remove_dir_all("/tmp/hunter-previews/")
.map_err(HError::from)
.log();
}
if file.kind == Kind::Directory {
let preview = Previewer::preview_dir(&file,