File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ import qualified Paths_haskell_language_server as Meta
13
13
import System.Info
14
14
import Data.Version
15
15
import Data.Maybe (listToMaybe )
16
+ import System.Directory
16
17
import System.Process
17
18
import System.Exit
18
19
import Text.ParserCombinators.ReadP
@@ -60,10 +61,12 @@ findProgramVersions = ProgramsOfInterest
60
61
-- If the invocation has a non-zero exit-code, we return 'Nothing'
61
62
findVersionOf :: FilePath -> IO (Maybe Version )
62
63
findVersionOf tool =
63
- readProcessWithExitCode tool [" --numeric-version" ] " " >>= \ case
64
- (ExitSuccess , sout, _) -> pure $ consumeParser myVersionParser sout
65
- _ -> pure $ Nothing
66
-
64
+ findExecutable tool >>= \ case
65
+ Nothing -> pure Nothing
66
+ Just path ->
67
+ readProcessWithExitCode path [" --numeric-version" ] " " >>= \ case
68
+ (ExitSuccess , sout, _) -> pure $ consumeParser myVersionParser sout
69
+ _ -> pure $ Nothing
67
70
where
68
71
myVersionParser = do
69
72
skipSpaces
You can’t perform that action at this time.
0 commit comments