mirror of
https://github.com/Start9Labs/registry.git
synced 2026-03-26 02:11:53 +00:00
ensure empty whitelist can be parsed
This commit is contained in:
@@ -17,7 +17,7 @@ import Startlude ( ($)
|
|||||||
, ByteString
|
, ByteString
|
||||||
, ConvertText(toS)
|
, ConvertText(toS)
|
||||||
, FilePath
|
, FilePath
|
||||||
|
|
||||||
, Monad(return)
|
, Monad(return)
|
||||||
, Monoid(mempty)
|
, Monoid(mempty)
|
||||||
, Text
|
, Text
|
||||||
@@ -25,6 +25,7 @@ import Startlude ( ($)
|
|||||||
, either
|
, either
|
||||||
, id
|
, id
|
||||||
, panic
|
, panic
|
||||||
|
, map
|
||||||
)
|
)
|
||||||
|
|
||||||
import qualified Control.Exception as Exception
|
import qualified Control.Exception as Exception
|
||||||
@@ -59,7 +60,7 @@ import Orphans.Emver ( )
|
|||||||
import Lib.Types.Core (PkgId)
|
import Lib.Types.Core (PkgId)
|
||||||
import Data.String
|
import Data.String
|
||||||
import Data.List.Extra (splitOn)
|
import Data.List.Extra (splitOn)
|
||||||
import Prelude (map, read)
|
import Text.Read (read)
|
||||||
-- | Runtime settings to configure this application. These settings can be
|
-- | Runtime settings to configure this application. These settings can be
|
||||||
-- loaded from various sources: defaults, environment variables, config files,
|
-- loaded from various sources: defaults, environment variables, config files,
|
||||||
-- theoretically even a database.
|
-- theoretically even a database.
|
||||||
@@ -149,6 +150,7 @@ compileTimeAppSettings = case fromJSON $ applyEnvValue False mempty configSettin
|
|||||||
Success settings -> settings
|
Success settings -> settings
|
||||||
|
|
||||||
parseCommaSeparatedList :: String -> [PkgId]
|
parseCommaSeparatedList :: String -> [PkgId]
|
||||||
parseCommaSeparatedList input = do
|
parseCommaSeparatedList input =
|
||||||
let strings = splitOn "," input
|
case splitOn "," input of
|
||||||
map read strings
|
[""] -> []
|
||||||
|
xs -> map read xs
|
||||||
Reference in New Issue
Block a user