Unverified Commit b852b6ac authored by Mikhail Glushenkov's avatar Mikhail Glushenkov Committed by GitHub
Browse files

Merge pull request #4923 from fgaz/f-a/do-not-create-folders-when-failing

Do not create folders when failing on no .project or .cabal file
parents 8112bdd2 03fe14c9
......@@ -328,9 +328,6 @@ rebuildProjectConfig verbosity
phaseReadProjectConfig = do
liftIO $ do
info verbosity "Project settings changed, reconfiguring..."
createDirectoryIfMissingVerbose verbosity True distDirectory
createDirectoryIfMissingVerbose verbosity True distProjectCacheDirectory
readProjectConfig verbosity projectConfigConfigFile distDirLayout
-- Look for all the cabal packages in the project
......@@ -340,6 +337,13 @@ rebuildProjectConfig verbosity
-> Rebuild [PackageSpecifier UnresolvedSourcePackage]
phaseReadLocalPackages projectConfig = do
localCabalFiles <- findProjectPackages distDirLayout projectConfig
-- Create folder only if findProjectPackages did not throw a
-- Badpackagelocations exception
liftIO $ do
createDirectoryIfMissingVerbose verbosity True distDirectory
createDirectoryIfMissingVerbose verbosity True distProjectCacheDirectory
mapM (readSourcePackage verbosity) localCabalFiles
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment