Engine 0.0.6
Game engine in lua
Loading...
Searching...
No Matches
fs.lua
Go to the documentation of this file.
1local function replace(args)
2 local file_in = io.open(args.file,'r')
3
4 if not file_in then
5 return false, 'file not found: '..args.file
6 end
7
8 local content = (file_in:read('*a') or ''):gsub(args.format, args.replace)
9 file_in:close()
10
11 local file_out = io.open(args.dist, 'w')
12
13 file_out:write(content)
14 file_out:close()
15
16 return true
17end
18
19local function download(args)
20 return false, 'not implemented!'
21end
22
23local P = {
24 ['fs-replace'] = replace,
25 ['fs-download'] = download
26}
27
28return P
local function download(args)
local function replace(args)