LuaComp/src/shell_var.lua

17 lines
408 B
Lua

-- This Source Code Form is subject to the terms of the Mozilla Public
-- License, v. 2.0. If a copy of the MPL was not distributed with this
-- file, You can obtain one at https://mozilla.org/MPL/2.0/.
svar = {}
do
local stdlib = require("posix.stdlib")
function svar.get(var)
return os.getenv(var)
end
function svar.set(var, val)
return stdlib.setenv(var, val and tostring(val) or nil)
end
end