mirror of
https://github.com/Hilbis/Hilbish
synced 2025-04-21 13:03:22 +00:00
this removes the old "virtual global table" which allows getting environment variables via just their names in lua. this means: an environment variable (like TERM) would need to be accessed via the `env` table instead of just using TERM in lua. `TERM` -> `env.TERM` they can also be set via `env.VARIABLE = 'value'
11 lines
152 B
Lua
11 lines
152 B
Lua
env = {}
|
|
|
|
setmetatable(env, {
|
|
__index = function(_, k)
|
|
return os.getenv(k)
|
|
end,
|
|
__newindex = function(_, k, v)
|
|
os.setenv(k, tostring(v))
|
|
end
|
|
})
|