Skip to content
Permalink
Browse files
rgen now converts archive to binary string.
  • Loading branch information
James King committed Aug 26, 2013
1 parent 89d742f commit 2285e22
Showing 1 changed file with 9 additions and 5 deletions.
@@ -59,12 +59,16 @@ if err then
end
]]

local archiveTable = { }
for i = 1, #archiveBytes do
archiveTable[i] = "\\" .. archiveBytes:sub(i, i):byte()
end

local archiveConverted = table.concat(archiveTable)

local f = code:find("$", 1, true)
code = code:sub(1, f - 1) .. archiveBytes:
gsub("\0", "\\0"):
gsub("\n", "\\n"):
gsub("'", "\\'") .. code:sub(f + 1)
f = code:find("$", f + #archiveBytes, true)
code = code:sub(1, f - 1) .. archiveConverted .. code:sub(f + 1)
f = code:find("$", f + #archiveConverted, true)
code = code:sub(1, f - 1) .. mainClass .. code:sub(f + 1)

local out = fs.open(target, "w")

0 comments on commit 2285e22

Please sign in to comment.