From 3a658c891e7f4f8966a83cd709b2b7468226457f Mon Sep 17 00:00:00 2001 From: Sergey Matveev Date: Mon, 27 Sep 2021 15:54:43 +0300 Subject: [PATCH] Fix mtimeless touch logic --- main.go | 2 +- refresh.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/main.go b/main.go index 417c2c1..83bde1b 100644 --- a/main.go +++ b/main.go @@ -44,7 +44,7 @@ import ( ) const ( - Version = "3.0.0" + Version = "3.1.0" UserAgent = "GoCheese/" + Version ) diff --git a/refresh.go b/refresh.go index 55c30e0..59c8ceb 100644 --- a/refresh.go +++ b/refresh.go @@ -551,8 +551,8 @@ func refreshDir( } path = path + "." + hashAlgo stat, err := os.Stat(path) - if err == nil && - (mtimeExists && stat.ModTime().Truncate(time.Second).Equal(mtime)) { + if err == nil && (!mtimeExists || + (mtimeExists && stat.ModTime().Truncate(time.Second).Equal(mtime))) { continue } if err != nil && !os.IsNotExist(err) { -- 2.44.0