mirror of
https://github.com/hkalexling/Mango.git
synced 2026-05-01 00:00:55 -04:00
Allow config defaults to be sourced from ENV
This allows the default config to source values from ENV variables if they are set. With this change we don't have to modify the docker CMD or edit the config.yml and then relaunch.
This commit is contained in:
+2
-2
@@ -95,9 +95,9 @@ class String
|
||||
end
|
||||
end
|
||||
|
||||
def env_is_true?(key : String) : Bool
|
||||
def env_is_true?(key : String, default : Bool = false) : Bool
|
||||
val = ENV[key.upcase]? || ENV[key.downcase]?
|
||||
return false unless val
|
||||
return default unless val
|
||||
val.downcase.in? "1", "true"
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user