Skip to content
This repository was archived by the owner on Nov 4, 2024. It is now read-only.

Commit

Permalink
Assign new mtime only if touch() was successful.
Browse files Browse the repository at this point in the history
  • Loading branch information
jdalton committed Mar 24, 2019
1 parent 51d31ef commit 0da1bf4
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/entry.js
Original file line number Diff line number Diff line change
Expand Up @@ -204,8 +204,11 @@ class Entry {
mtime = getStatTimestamp(stat, "mtime")

if (mtime === getStatTimestamp(stat, "birthtime")) {
mtime = Date.now()
touch(filename, mtime)
const now = Date.now()

if (touch(filename, now)) {
mtime = now
}
}
}
}
Expand Down

0 comments on commit 0da1bf4

Please sign in to comment.