Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extraction of VCS revisions in sub-directories #43

Closed
larskuhtz opened this issue Apr 14, 2015 · 2 comments
Closed

Extraction of VCS revisions in sub-directories #43

larskuhtz opened this issue Apr 14, 2015 · 2 comments

Comments

@larskuhtz
Copy link
Member

The generated PkgInfo modules check for the revision control system with the following code.

getVCS :: IO (Maybe RepoType)
getVCS =
    doesDirectoryExist ".hg" >>= \x0 -> if x0
    then return (Just Mercurial)
    else doesDirectoryExist ".git" >>= \x1 -> return $ if x1
        then Just Git
        else Nothing

This code only works correctly if called in the root directory of the repository. It's a common practice to develop more than one cabal package in a single repository by placing each package in a sub-directory. For that we must support detection of the VCS in sub-directories.

getVCS :: IO (Maybe RepoType)
getVCS =
    doesDirectoryExist ".hg" >>= \x0 -> if x0
    then return (Just Mercurial)
    else doesDirectoryExist ".git" >>= \x1 -> return $ if x1
        then Just Git
        else Nothing {- TODO if pwd is not call getVCS on ".." -}
@larskuhtz
Copy link
Member Author

Thanks @gregwebs for reporting this issue!

@larskuhtz
Copy link
Member Author

Solved by #44

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant