archive addFile and attachFiles

This commit is contained in:
2021-08-01 23:11:11 -06:00
parent cbf8a9d536
commit 220fe36b58
3 changed files with 20 additions and 2 deletions

View File

@@ -51,6 +51,13 @@
,@saveList
,retValSymbol)))
(function addFile [:Archive archive :Entry e :String file &opt leaveOriginalCopy]
(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))
(e.files.push pathWithoutDir))))
(defMacro withWritableEntry [archive e &body body]
(let [retValSymbol
(symbol)]