Explorar o código

only update time after hashes written

ncannasse %!s(int64=7) %!d(string=hai) anos
pai
achega
944371a79f
Modificáronse 1 ficheiros con 9 adicións e 4 borrados
  1. 9 4
      hxd/fs/LocalFileSystem.hx

+ 9 - 4
hxd/fs/LocalFileSystem.hx

@@ -455,11 +455,15 @@ class LocalFileSystem implements FileSystem {
 		}
 		var content = hxd.File.getBytes(realFile);
 		var hash = haxe.crypto.Sha1.make(content).toHex();
-		times.set(path, time);
-		hxd.File.saveBytes(tmpDir + "times.dat", haxe.io.Bytes.ofString(haxe.Serializer.run(times)));
+		function updateTime() {
+			times.set(path, time);
+			hxd.File.saveBytes(tmpDir + "times.dat", haxe.io.Bytes.ofString(haxe.Serializer.run(times)));
+		}
 
-		if( hxd.File.exists(tmpFile) && hash == Reflect.field(root, e.name) )
+		if( hxd.File.exists(tmpFile) && hash == Reflect.field(root, e.name) ) {
+			updateTime();
 			return;
+		}
 
 		Reflect.setField(root, e.name, hash);
 
@@ -513,7 +517,8 @@ class LocalFileSystem implements FileSystem {
 			conv.srcFilename = null;
 		}
 
-		hxd.File.saveBytes(tmpDir + "hashes.json", haxe.io.Bytes.ofString(haxe.Json.stringify(hashes,"\t")));
+		hxd.File.saveBytes(tmpDir + "hashes.json", haxe.io.Bytes.ofString(haxe.Json.stringify(hashes, "\t")));
+		updateTime();
 	}
 
 }