Skip to content

Commit

Permalink
output the hashes into cfg.outputDir + "/hashes/" instead of in the i…
Browse files Browse the repository at this point in the history
…nput directory
  • Loading branch information
ninjamuffin99 committed Sep 1, 2024
1 parent 6da03c0 commit 338210c
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/dox/Dox.hx
Original file line number Diff line number Diff line change
Expand Up @@ -138,18 +138,24 @@ class Dox {
function parseFile(path) {
var name = new Path(path).file;
Sys.println('Parsing $path');

var hashPaths = cfg.outputPath + "/hashes/";

if (!FileSystem.exists(hashPaths))
FileSystem.createDirectory(hashPaths);

var data = sys.io.File.getContent(path);
var md5Hash = haxe.crypto.Md5.encode(data);

if (sys.FileSystem.exists(path + ".md5")) {
var previousHash = sys.io.File.getContent(path + ".md5");
if (sys.FileSystem.exists(hashPaths + name + ".md5")) {
var previousHash = sys.io.File.getContent(hashPaths + name + ".md5");
if (md5Hash == previousHash) {
Sys.println('Skipping $path, no file changes detected');
return;
}
}

sys.io.File.saveContent(path + ".md5", md5Hash);
sys.io.File.saveContent(hashPaths + name + ".md5", md5Hash);

var xml = try Xml.parse(data).firstElement() catch (err:Dynamic) {
trace('Error while parsing $path');
Expand Down

0 comments on commit 338210c

Please sign in to comment.