Merge branch 'dev' into fix/rescan-when-files-added

This commit is contained in:
Alex Ling
2022-07-03 15:44:02 +08:00
committed by GitHub
3 changed files with 64 additions and 27 deletions
+2 -2
View File
@@ -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