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
1313import System.Info
1414import Data.Version
1515import Data.Maybe (listToMaybe )
16+ import System.Directory
1617import System.Process
1718import System.Exit
1819import Text.ParserCombinators.ReadP
@@ -60,10 +61,12 @@ findProgramVersions = ProgramsOfInterest
6061-- If the invocation has a non-zero exit-code, we return 'Nothing'
6162findVersionOf :: FilePath -> IO (Maybe Version )
6263findVersionOf 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
6770 where
6871 myVersionParser = do
6972 skipSpaces
You can’t perform that action at this time.
0 commit comments