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

@@ -669,9 +669,10 @@ nukeCaches = do
chdir <- liftIO $ (</> "cabal-helper") <$> getAppUserDataDirectory "ghc-mod"
c <- cradle
when (cradleProjectType c == CabalProject) $ do
when (cradleProjectType c == CabalProject || cradleProjectType c == StackProject) $ do
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 = try