Accept github subdirs more than one level deep#399
Conversation
| case map T.unpack $ T.splitOn "/" input of | ||
| [owner, repo, subdir] -> return $ GitHub owner repo (Just subdir) | ||
| [owner, repo] -> return $ GitHub owner repo Nothing | ||
| (owner: _) | owner `elem` ["http:", "https:"] -> fail $ "expected owner/repo or owner/repo/subdir, but encountered url instead: " ++ show input |
There was a problem hiding this comment.
Had to add some hacky url detection because otherwise urls were being matched as
owner: "https:"
repo: ""
subdir: "github.com/sol/hpack/issues/365"
Not sure how to handle this robustly
sol
left a comment
There was a problem hiding this comment.
@alexfmpe Hey! Thanks for working on Hpack + sorry for the late response!
Instead of trying to shoehorn this into github:, how about we add more complete support for source-repository? At this point, I'm not eager to support everything from Cabal, but we can start with type, location and subdir (and possibly extend it in the future).
source-repository:
type: git
location: https://github.com/sol/hpack
subdir: some/lengthy/pathsource-repository: ... should take precedence over github: ..., that is if both github: ... and source-repository: ... are specified, then homepage, bug-reports should be derived from github: ... while the .cabal source-repository head should derived from source-repository: ...
No description provided.