Disable 'cabal' cradle when executable isn't found
This commit is contained in:
parent
ab3dccc77c
commit
3ae9204b95
@ -69,12 +69,16 @@ fillTempDir crdl = do
|
||||
tmpDir <- liftIO $ newTempDir (cradleRootDir crdl)
|
||||
return crdl { cradleTempDir = tmpDir }
|
||||
|
||||
cabalCradle :: IOish m => FilePath -> MaybeT m Cradle
|
||||
cabalCradle :: (IOish m, GmLog m, GmOut m) => FilePath -> MaybeT m Cradle
|
||||
cabalCradle wdir = do
|
||||
cabalFile <- MaybeT $ liftIO $ findCabalFile wdir
|
||||
|
||||
let cabalDir = takeDirectory cabalFile
|
||||
|
||||
-- If cabal doesn't exist the user probably wants to use something else
|
||||
whenM (isJust <$> liftIO (findExecutable "cabal")) $ do
|
||||
gmLog GmWarning "" $ text "'dist/setup-config' exists but 'cabal' executable wasn't found."
|
||||
mzero
|
||||
|
||||
return Cradle {
|
||||
cradleProject = CabalProject
|
||||
, cradleCurrentDir = wdir
|
||||
|
Loading…
Reference in New Issue
Block a user