Skip to content
This repository was archived by the owner on Oct 7, 2020. It is now read-only.

Commit 3f67948

Browse files
committed
fail installation if cabal-version is too low
1 parent bba0091 commit 3f67948

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

install/src/Cabal.hs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -56,15 +56,14 @@ cabalInstallHie versionNumber = do
5656
installCabal :: Action ()
5757
installCabal = do
5858
-- try to find existing `cabal` executable with appropriate version
59-
cabalExe <- liftIO (findExecutable "cabal") >>= \case
60-
Nothing -> return Nothing
61-
Just cabalExe -> do
62-
cabalVersion <- trimmedStdout <$> execCabal ["--numeric-version"]
63-
whenMaybe (checkVersion requiredCabalVersion cabalVersion)
64-
$ return cabalExe
59+
cabalExeOk <- liftIO (findExecutable "cabal") >>= \case
60+
Nothing -> return False
61+
Just _ -> do
62+
checkCabal
63+
return True
6564

6665
-- install `cabal-install` if not already installed
67-
when (isNothing cabalExe) $ execStackShake_ ["install", "cabal-install"]
66+
unless cabalExeOk $ execStackShake_ ["install", "cabal-install"]
6867

6968
-- | check `stack` has the required version
7069
checkCabal :: Action ()

0 commit comments

Comments
 (0)