@@ -201,7 +201,10 @@ Just (Ex (ProjLocV2File { plProjectDirV2 = "/Foo/"}))
201
201
202
202
In the given example, it is not guaranteed which project type is found,
203
203
it is only guaranteed that it will not identify the project
204
- as a cabal v1-project.
204
+ as a cabal v1-project. Note that with cabal-helper version (1.0),
205
+ by default a *.cabal file is identified as a 'ProjLocV2Dir' project.
206
+ The same issue as before exists and we look for a 'ProjLocV2File' or
207
+ 'ProjLocStackYaml' before deciding that 'ProjLocV2Dir' marks the project root.
205
208
206
209
Note that this will not return any project types for which the corresponding
207
210
build tool is not on the PATH. This is "stack" and "cabal" for stack and cabal
@@ -219,13 +222,13 @@ findCabalHelperEntryPoint fp = do
219
222
let supportedProjs = filter (\ x -> supported x isStackInstalled isCabalInstalled) allProjs
220
223
debugm $ " These projects have the build tools installed: " ++ show (map (\ (Ex x) -> show x) supportedProjs)
221
224
222
- case filter (\ p -> isCabalNewProject p || isStackProject p) supportedProjs of
225
+ case filter (\ p -> isCabalV2FileProject p || isStackProject p) supportedProjs of
223
226
(x: _) -> return $ Just x
224
- [] -> case filter isCabalOldProject supportedProjs of
227
+ [] -> case filter isCabalProject supportedProjs of
225
228
(x: _) -> return $ Just x
226
229
[] -> return Nothing
227
230
where
228
- supported :: ( Ex ProjLoc ) -> Bool -> Bool -> Bool
231
+ supported :: Ex ProjLoc -> Bool -> Bool -> Bool
229
232
supported (Ex ProjLocStackYaml {}) stackInstalled _ = stackInstalled
230
233
supported (Ex ProjLocV2Dir {}) _ cabalInstalled = cabalInstalled
231
234
supported (Ex ProjLocV2File {}) _ cabalInstalled = cabalInstalled
@@ -235,13 +238,14 @@ findCabalHelperEntryPoint fp = do
235
238
isStackProject (Ex ProjLocStackYaml {}) = True
236
239
isStackProject _ = False
237
240
238
- isCabalNewProject (Ex ProjLocV2Dir {}) = True
239
- isCabalNewProject (Ex ProjLocV2File {}) = True
240
- isCabalNewProject _ = False
241
+ isCabalV2FileProject (Ex ProjLocV2File {}) = True
242
+ isCabalV2FileProject _ = False
241
243
242
- isCabalOldProject (Ex ProjLocV1Dir {}) = True
243
- isCabalOldProject (Ex ProjLocV1CabalFile {}) = True
244
- isCabalOldProject _ = False
244
+ isCabalProject (Ex ProjLocV1CabalFile {}) = True
245
+ isCabalProject (Ex ProjLocV1Dir {}) = True
246
+ isCabalProject (Ex ProjLocV2File {}) = True
247
+ isCabalProject (Ex ProjLocV2Dir {}) = True
248
+ isCabalProject _ = False
245
249
246
250
{- | Given a FilePath, find the cradle the FilePath belongs to.
247
251
0 commit comments