From b3731c433c94c12f280500ba49a31e4093078d30 Mon Sep 17 00:00:00 2001 From: Nat Quayle Nelson Date: Thu, 30 Sep 2021 22:18:39 -0600 Subject: [PATCH] Don't try to overwrite duplicate NAT images --- projects/nat-archive-tool/src/nat/Lib.kiss | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/projects/nat-archive-tool/src/nat/Lib.kiss b/projects/nat-archive-tool/src/nat/Lib.kiss index fe76a2e4..9701f3cd 100644 --- a/projects/nat-archive-tool/src/nat/Lib.kiss +++ b/projects/nat-archive-tool/src/nat/Lib.kiss @@ -78,8 +78,10 @@ (doFor file files (let [pathWithoutDir (haxe.io.Path.withoutDirectory file)] (unless !(= -1 (e.files.indexOf pathWithoutDir)) - ((if leaveOriginalCopy sys.io.File.copy sys.FileSystem.rename) - file (joinPath archive.archiveDir "files" pathWithoutDir)) + (let [pathInArchive (joinPath archive.archiveDir "files" pathWithoutDir)] + (unless (sys.FileSystem.exists pathInArchive) + ((if leaveOriginalCopy sys.io.File.copy sys.FileSystem.rename) + file pathInArchive))) (e.files.push pathWithoutDir)))))) (function addTags [:nat.Archive archive :nat.Entry e :Array tagsToAdd]