1
0
mirror of https://github.com/Adorable-Catgirl/LuaComp.git synced 2024-11-01 08:00:56 +11:00
LuaComp/src/shell_var.lua

13 lines
204 B
Lua
Raw Normal View History

2020-03-19 05:08:15 +11:00
svar = {}
2019-12-15 08:23:07 +11:00
2021-06-25 19:31:33 +10:00
do
local stdlib = require("posix.stdlib")
2019-12-15 08:23:07 +11:00
2021-06-25 19:31:33 +10:00
function svar.get(var)
return os.getenv(var)
end
2019-12-15 08:23:07 +11:00
2021-06-25 19:31:33 +10:00
function svar.set(var, val)
return stdlib.setenv(var, val and tostring(val) or nil)
end
2019-12-15 08:23:07 +11:00
end