Fix race condition in stack support code

This commit is contained in:
Daniel Gröber
2015-09-11 03:48:52 +02:00
parent 12d65ba11f
commit 211b957451
9 changed files with 74 additions and 65 deletions

View File

@@ -679,7 +679,7 @@ nukeCaches = do
chdir <- liftIO $ (</> "cabal-helper") <$> getAppUserDataDirectory "ghc-mod"
c <- cradle
when (cradleProjectType c == CabalProject || cradleProjectType c == StackProject) $ do
when (isCabalHelperProject $ cradleProject c) $ do
let root = cradleRootDir c
let dist = cradleDistDir c
liftIO $ (trySome . removeDirectoryRecursive) `mapM_` [chdir, root </> dist]