Skip to content
  • Duncan Coutts's avatar
    elaborate impl of findProjectRoot · 5b1eca08
    Duncan Coutts authored
    Take an extra arg to control where to start searching, not just process
    current directory. This is mainly to make it easier to test without
    having to mutate the cwd but is potentially useful generally for
    cwd-independence.
    
    Return more detailed info: not just the directory but return if it's an
    implicit or an explict project root with a cabal.project file. In the
    latter case also return the cabal.project file since its name can be
    overridden. Then also adjust defaultDistDirLayout to take this more
    detailed ProjectRoot type, thus avoiding having to duplicate the logic
    about the location of the cabal.project file.
    
    Change the behaviour so that if an explicit cabal.project file name is
    given and it is not found then fail, rather than falling back to an
    implicit project root style. This would seem to make most sense: if the
    user specifies an explict cabal.project file then it'd be odd if we
    silently ignore that if the user misspells it or something. The implicit
    root default is really for the really simple case, not when users are
    explicitly specifying stuff.
    
    Also add a couple simple tests for findProjectRoot.
    5b1eca08