From c70e8076803bd29d7675ed493ebb1ca246891b34 Mon Sep 17 00:00:00 2001 From: Daniel Gröber Date: Tue, 6 Aug 2019 01:54:29 +0200 Subject: Fix ProjLoc to source directory correspondence We cannot always assume `takeDirectory cfg_file` will be the project source directory! --- lib/Distribution/Helper/Discover.hs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib/Distribution/Helper') diff --git a/lib/Distribution/Helper/Discover.hs b/lib/Distribution/Helper/Discover.hs index 9e6a7ca..93346f5 100644 --- a/lib/Distribution/Helper/Discover.hs +++ b/lib/Distribution/Helper/Discover.hs @@ -55,7 +55,7 @@ findProjects :: FilePath -> IO [Ex ProjLoc] findProjects dir = execWriterT $ do let cabalProject = dir "cabal.project" whenM (liftIO $ doesFileExist cabalProject) $ - tell [Ex $ ProjLocV2File cabalProject] + tell [Ex $ ProjLocV2File cabalProject dir] let stackYaml = dir "stack.yaml" whenM (liftIO $ doesFileExist stackYaml) $ tell [Ex $ ProjLocStackYaml stackYaml] @@ -74,8 +74,8 @@ getDefaultDistDir (ProjLocV1CabalFile _cabal_file pkgdir) = DistDirCabal SCV1 $ pkgdir "dist" getDefaultDistDir (ProjLocV1Dir pkgdir) = DistDirCabal SCV1 $ pkgdir "dist" -getDefaultDistDir (ProjLocV2File cabal_project) = - DistDirCabal SCV2 $ replaceFileName cabal_project "dist-newstyle" +getDefaultDistDir (ProjLocV2File cabal_project projdir) = + DistDirCabal SCV2 $ projdir "dist-newstyle" getDefaultDistDir (ProjLocV2Dir projdir) = DistDirCabal SCV2 $ projdir "dist-newstyle" getDefaultDistDir (ProjLocStackYaml _) = -- cgit v1.2.3