Add loader for environment variables
This commit is contained in:
parent
8294716cfa
commit
4775ec851d
2 changed files with 9 additions and 0 deletions
|
@ -16,6 +16,7 @@ build = {
|
|||
glass = "glass.lua",
|
||||
["glass.cosmo"] = "glass/cosmo.lua",
|
||||
["glass.discount"] = "glass/discount.lua",
|
||||
["glass.environment"] = "glass/environment.lua",
|
||||
["glass.json"] = "glass/json.lua",
|
||||
["glass.lua"] = "glass/lua.lua",
|
||||
["glass.moonhtml"] = "glass/moonhtml.lua",
|
||||
|
|
8
glass/environment.lua
Normal file
8
glass/environment.lua
Normal file
|
@ -0,0 +1,8 @@
|
|||
--- Loader for environment variables
|
||||
-- @module glass.environment
|
||||
|
||||
--- Loads values from environment variables
|
||||
-- @treturn string The value of the environment variable
|
||||
return function(name)
|
||||
return os.getenv(name:match("[^/].+$"))
|
||||
end
|
Loading…
Reference in a new issue