aboutsummaryrefslogtreecommitdiff
path: root/Config.hs
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.hs
parentecab35e095a97083285911809cc81d44a4384196 (diff)
use DynamicConfig to handle cost-command
This commit was sponsored by Jake Vosloo on Patreon.
Diffstat (limited to 'Config.hs')
-rw-r--r--Config.hs6
1 files changed, 2 insertions, 4 deletions
diff --git a/Config.hs b/Config.hs
index 3eecf4a4e..783f07238 100644
--- a/Config.hs
+++ b/Config.hs
@@ -15,6 +15,7 @@ import qualified Git.Config
import qualified Git.Command
import qualified Annex
import Config.Cost
+import Config.DynamicConfig
import Types.Availability
import Git.Types
@@ -70,10 +71,7 @@ remoteCost :: RemoteGitConfig -> Cost -> Annex Cost
remoteCost c d = fromMaybe d <$> remoteCost' c
remoteCost' :: RemoteGitConfig -> Annex (Maybe Cost)
-remoteCost' c = case remoteAnnexCostCommand c of
- Just cmd | not (null cmd) -> liftIO $
- readish <$> readProcess "sh" ["-c", cmd]
- _ -> return $ remoteAnnexCost c
+remoteCost' = liftIO . getDynamicConfig . remoteAnnexCost
setRemoteCost :: Git.Repo -> Cost -> Annex ()
setRemoteCost r c = setConfig (remoteConfig r "cost") (show c)