use DynamicConfig to handle cost-command
This commit was sponsored by Jake Vosloo on Patreon.
This commit is contained in:
parent
68a0f99ba6
commit
61e96621d8
3 changed files with 12 additions and 10 deletions
|
@ -7,9 +7,9 @@
|
|||
|
||||
module Config.DynamicConfig where
|
||||
|
||||
import Control.Concurrent.STM
|
||||
import Common
|
||||
|
||||
import Utility.SafeCommand
|
||||
import Control.Concurrent.STM
|
||||
|
||||
-- | A configuration value that may only be known after performing an IO
|
||||
-- action. The IO action will only be run the first time the configuration
|
||||
|
@ -42,3 +42,6 @@ successfullCommandRunner cmd = boolSystem "sh" [Param "-c", Param cmd]
|
|||
|
||||
unsuccessfullCommandRunner :: CommandRunner Bool
|
||||
unsuccessfullCommandRunner cmd = not <$> successfullCommandRunner cmd
|
||||
|
||||
readCommandRunner :: Read a => CommandRunner (Maybe a)
|
||||
readCommandRunner cmd = readish <$> readProcess "sh" ["-c", cmd]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue