File: b64.lua

package info (click to toggle)
love 11.5-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 18,296 kB
  • sloc: cpp: 145,635; ansic: 70,970; makefile: 333; sh: 232; xml: 7
file content (12 lines) | stat: -rw-r--r-- 239 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
function b64(name)
	local i = io.popen("base64 " .. name)
	local encoded = i:read("*a")
	i:close()

	local output = ("local %s =\n%q"):format(name:gsub("%.", "_"), encoded)
	return output
end

for i, v in ipairs(arg) do
	print(b64(v))
end