aboutsummaryrefslogtreecommitdiff
path: root/lib/Distribution/Helper
diff options
context:
space:
mode:
authorDaniel Gröber <dxld@darkboxed.org>2019-08-06 01:54:29 +0200
committerDaniel Gröber (dxld) <dxld@darkboxed.org>2019-09-17 17:48:26 +0200
commitc70e8076803bd29d7675ed493ebb1ca246891b34 (patch)
tree1f8d279b2b0edc90cce2df08496e62f2a9b86130 /lib/Distribution/Helper
parentfe57ad27c239a4eaf2401a9874182492fa9f3af9 (diff)
Fix ProjLoc to source directory correspondence
We cannot always assume `takeDirectory cfg_file` will be the project source directory!
Diffstat (limited to 'lib/Distribution/Helper')
-rw-r--r--lib/Distribution/Helper/Discover.hs6
1 files changed, 3 insertions, 3 deletions
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 _) =