serialize config with function
This commit is contained in:
@ -169,4 +169,15 @@ function file_exists(name)
|
||||
else
|
||||
return false
|
||||
end
|
||||
end
|
||||
|
||||
-- Save into file the data serialized for lua.
|
||||
function serialize_to_file(data, file)
|
||||
file = io.open(file, 'w+')
|
||||
local serialized = serpent.block(data, {
|
||||
comment = false,
|
||||
name = "_"
|
||||
})
|
||||
file:write(serialized)
|
||||
file:close()
|
||||
end
|
Reference in New Issue
Block a user