use the ~/.config/git-annex/program file to find command when running transfers

This commit is contained in:
Joey Hess 2012-08-27 13:43:03 -04:00
parent b12db9ef92
commit 2433f6ca5a
5 changed files with 21 additions and 15 deletions

View file

@ -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"