Cleanup project type handling

This commit is contained in:
Daniel Gröber
2015-08-12 09:25:13 +02:00
parent a94d8977a9
commit 28f06e035d
7 changed files with 33 additions and 36 deletions

View File

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