aboutsummaryrefslogtreecommitdiff
path: root/Config
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2017-08-17 14:04:29 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2017-08-17 14:04:29 -0400
commit4bdd8083ad7d77de41a2389aed87805eb354d358 (patch)
tree1a2f8e485859013c564773ff458fa223476bcc9b /Config
parentecab35e095a97083285911809cc81d44a4384196 (diff)
use DynamicConfig to handle cost-command
This commit was sponsored by Jake Vosloo on Patreon.
Diffstat (limited to 'Config')
-rw-r--r--Config/DynamicConfig.hs7
1 files changed, 5 insertions, 2 deletions
diff --git a/Config/DynamicConfig.hs b/Config/DynamicConfig.hs
index 095c7c641..de76e007b 100644
--- a/Config/DynamicConfig.hs
+++ b/Config/DynamicConfig.hs
@@ -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]