Mercurial Hosting > chat
view src/private/tools/save_config.txt.luan @ 38:436216d17a1b
fix edit and delete
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Tue, 12 Nov 2024 21:53:03 -0700 |
parents | b116b6ef07bf |
children | e229f4aacde0 |
line wrap: on
line source
local Luan = require "luan:Luan.luan" local error = Luan.error local parse = Luan.parse or error() local stringify = Luan.stringify or error() local Io = require "luan:Io.luan" local uri = Io.uri or error() local Http = require "luan:http/Http.luan" local Shared = require "site:/lib/Shared.luan" local config_file = Shared.config_file or error() return function() local config = Http.request.parameters.config or error() config = parse(config) uri("site:/private/local/").mkdir() config_file.write_text(stringify(config).."\n") Http.reset_luan() Io.stdout = Http.response.text_writer() %>saved<% end