diff options
author | Joey Hess <joeyh@joeyh.name> | 2015-02-10 11:59:55 -0400 |
---|---|---|
committer | Joey Hess <joeyh@joeyh.name> | 2015-02-10 11:59:59 -0400 |
commit | 73f4e0505a4f8c5565ecd7f65d57463b7fbb94c5 (patch) | |
tree | 005855229ed9fa46806c9f255ad39da214495bba /Utility | |
parent | f083a978ab523bf3eb9fca00564680791eb04bad (diff) |
addurl: Avoid crash if quvi is not installed, when git-annex was built with process-1.2
createProcess has been changed to throw an exception if the program is
not in path.
Diffstat (limited to 'Utility')
-rw-r--r-- | Utility/Quvi.hs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Utility/Quvi.hs b/Utility/Quvi.hs index 7f73809c0..33653b07b 100644 --- a/Utility/Quvi.hs +++ b/Utility/Quvi.hs @@ -22,6 +22,7 @@ data QuviVersion = Quvi04 | Quvi09 | NoQuvi + deriving (Show) data Page = Page { pageTitle :: String @@ -61,7 +62,8 @@ parseEnum s = Page m = M.fromList $ map (separate (== '=')) $ lines s probeVersion :: IO QuviVersion -probeVersion = examine <$> processTranscript "quvi" ["--version"] Nothing +probeVersion = catchDefaultIO NoQuvi $ + examine <$> processTranscript "quviaaa" ["--version"] Nothing where examine (s, True) | "quvi v0.4" `isInfixOf` s = Quvi04 |