summaryrefslogtreecommitdiff
path: root/Locations
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2012-08-27 13:43:03 -0400
committerGravatar Joey Hess <joey@kitenet.net>2012-08-27 13:43:03 -0400
commit2433f6ca5a602f55986bcd85c20034c88cc44a3b (patch)
tree03c10c84666301aa7252219f096867c08d662079 /Locations
parentb12db9ef9214d801280310222fc5e9d16f8af3de (diff)
use the ~/.config/git-annex/program file to find command when running transfers
Diffstat (limited to 'Locations')
-rw-r--r--Locations/UserConfig.hs9
1 files changed, 7 insertions, 2 deletions
diff --git a/Locations/UserConfig.hs b/Locations/UserConfig.hs
index 9b04aed61..5da58eb9f 100644
--- a/Locations/UserConfig.hs
+++ b/Locations/UserConfig.hs
@@ -7,10 +7,9 @@
module Locations.UserConfig where
+import Common
import Utility.FreeDesktop
-import System.FilePath
-
{- ~/.config/git-annex/file -}
userConfigFile :: FilePath -> IO FilePath
userConfigFile file = do
@@ -24,3 +23,9 @@ autoStartFile = userConfigFile "autostart"
- has installed it to some aweful non-PATH location. -}
programFile :: IO FilePath
programFile = userConfigFile "program"
+
+{- Returns a command to run for git-annex. -}
+readProgramFile :: IO FilePath
+readProgramFile = do
+ programfile <- programFile
+ catchDefaultIO (readFile programfile) "git-annex"