add 'StackProject' around

This commit is contained in:
scturtle 2015-08-18 20:55:45 +08:00 committed by Daniel Gröber
parent a285b42206
commit d660e7cd85
3 changed files with 5 additions and 3 deletions

View File

@ -119,7 +119,7 @@ prepareCabalHelper = do
let projdir = cradleRootDir crdl let projdir = cradleRootDir crdl
distdir = projdir </> cradleDistDir crdl distdir = projdir </> cradleDistDir crdl
readProc <- gmReadProcess readProc <- gmReadProcess
when (cradleProjectType crdl == CabalProject) $ when (cradleProjectType crdl == CabalProject || cradleProjectType crdl == StackProject) $
withCabal $ liftIO $ prepare readProc projdir distdir withCabal $ liftIO $ prepare readProc projdir distdir
parseCustomPackageDb :: String -> [GhcPkgDb] parseCustomPackageDb :: String -> [GhcPkgDb]

View File

@ -27,6 +27,7 @@ debugInfo = do
cabal <- cabal <-
case cradleProjectType of case cradleProjectType of
CabalProject -> cabalDebug CabalProject -> cabalDebug
StackProject -> cabalDebug
_ -> return [] _ -> return []
pkgOpts <- packageGhcOptions pkgOpts <- packageGhcOptions

View File

@ -669,9 +669,10 @@ nukeCaches = do
chdir <- liftIO $ (</> "cabal-helper") <$> getAppUserDataDirectory "ghc-mod" chdir <- liftIO $ (</> "cabal-helper") <$> getAppUserDataDirectory "ghc-mod"
c <- cradle c <- cradle
when (cradleProjectType c == CabalProject) $ do when (cradleProjectType c == CabalProject || cradleProjectType c == StackProject) $ do
let root = cradleRootDir c let root = cradleRootDir c
liftIO $ (trySome . removeDirectoryRecursive) `mapM_` [chdir, root </> "dist"] let dist = cradleDistDir c
liftIO $ (trySome . removeDirectoryRecursive) `mapM_` [chdir, root </> dist]
trySome :: IO a -> IO (Either SomeException a) trySome :: IO a -> IO (Either SomeException a)
trySome = try trySome = try