Skip to content

Commit 723a0b3

Browse files
author
Greg Bowler
committed
Use filemtime for Windows compatibility (file locking)
1 parent 5e4a506 commit 723a0b3

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/Task.php

+4-4
Original file line numberDiff line numberDiff line change
@@ -50,15 +50,15 @@ public function build():bool {
5050
$changes = false;
5151

5252
foreach(Glob::glob($this->absolutePath) as $matchedPath) {
53-
$md5 = md5_file($matchedPath);
54-
$existingMd5 = $this->fileHashList[$matchedPath] ?? null;
53+
$hash = filemtime($matchedPath);
54+
$existingHash = $this->fileHashList[$matchedPath] ?? null;
5555

56-
if($md5 !== $existingMd5) {
56+
if($hash !== $existingHash) {
5757
$this->execute();
5858
$changes = true;
5959
}
6060

61-
$this->fileHashList[$matchedPath] = $md5;
61+
$this->fileHashList[$matchedPath] = $hash;
6262
}
6363

6464
return $changes;

0 commit comments

Comments
 (0)