gitdown icon indicating copy to clipboard operation
gitdown copied to clipboard

Invalid remote origin URL in non-Github repo

Open Lakitna opened this issue 4 years ago • 1 comments

I was looking into using gitdown for a thing. However, I'm working with an Azure DevOps repository, which is triggering an edge case.

The thing that is tripping me up right now is the error below thrown by gitinfo. I've anonymized some values in the stack trace ;)

Error: Invalid remote origin URL ("https://{organization_name}@dev.azure.com/{organization_name}/{project_name}/_git/{repository_name}").
    at parseRemoteOriginUrl ({repo_root}\node_modules\gitinfo\dist\utils.js:74:11)
    at Object.gitinfo.getUsername ({repo_root}\node_modules\gitinfo\dist\gitinfo.js:132:44)
    at Object.gitinfo.getGithubUrl ({repo_root}\node_modules\gitinfo\dist\gitinfo.js:51:44)
    at Object.helper.compile ({repo_root}\node_modules\gitdown\dist\helpers\gitinfo.js:36:41)
    at Object.gitdown.resolveURLs ({repo_root}\node_modules\gitdown\dist\gitdown.js:111:35)
    at Object.gitdown.get ({repo_root}\node_modules\gitdown\dist\gitdown.js:54:19)
    at async Object.gitdown.writeFile ({repo_root}\node_modules\gitdown\dist\gitdown.js:66:26)

I have no interest in using this functionality and have not included any of the gitinfo things in the Markdown files. However, it still tries to gather the information with the error as a result. I have not found an option to simply disable gitinfo altogether.

I've taken a look at the source code of gitinfo (different repo, I know) and it assumes a Github repo. That makes it a very good idea to allow gitdown users to disable the gitinfo parsing imo.

Lakitna avatar Jun 28 '21 09:06 Lakitna

Would accept a PR that allows to disable gitinfo.

gajus avatar Jun 28 '21 16:06 gajus