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

Running npm run create-readme fails #1057

Closed
kraenhansen opened this issue May 2, 2023 · 3 comments
Closed

Running npm run create-readme fails #1057

kraenhansen opened this issue May 2, 2023 · 3 comments

Comments

@kraenhansen
Copy link
Contributor

Running npm run create-readme yields the following error:

Error: Branch ("main") definition does not exist in the config.
    at Object.gitinfo.getRemoteUrl (/Users/kraen.hansen/Projects/eslint-plugin-jsdoc/node_modules/gitinfo/dist/gitinfo.js:100:13)
    at Object.gitinfo.getUsername (/Users/kraen.hansen/Projects/eslint-plugin-jsdoc/node_modules/gitinfo/dist/gitinfo.js:132:53)
    at Object.gitinfo.getGithubUrl (/Users/kraen.hansen/Projects/eslint-plugin-jsdoc/node_modules/gitinfo/dist/gitinfo.js:51:44)
    at Object.helper.compile (/Users/kraen.hansen/Projects/eslint-plugin-jsdoc/node_modules/gitdown/dist/helpers/gitinfo.js:36:41)
    at Object.gitdown.resolveURLs (/Users/kraen.hansen/Projects/eslint-plugin-jsdoc/node_modules/gitdown/dist/gitdown.js:113:35)
    at Object.gitdown.get (/Users/kraen.hansen/Projects/eslint-plugin-jsdoc/node_modules/gitdown/dist/gitdown.js:56:19)
    at async Promise.all (index 0)
    at generateDocs (/Users/kraen.hansen/Projects/eslint-plugin-jsdoc/src/bin/generateDocs.js:123:23)
    at async Promise.all (index 0)
    at generateDocsAndWriteToDisk (/Users/kraen.hansen/Projects/eslint-plugin-jsdoc/src/bin/generateDocs.js:208:7)
    at main (/Users/kraen.hansen/Projects/eslint-plugin-jsdoc/src/bin/generateDocs.js:247:7)

Environment

  • Node version: v18.9.0
  • ESLint version: N/A
  • eslint-plugin-jsdoc version: ec278a2
@brettz9
Copy link
Collaborator

brettz9 commented May 2, 2023

Per gajus/gitdown#27 , it looks like this can occur when there is no remote URL for the branch (maybe because master is in use on gajus?). Gitdown apparently uses this for URL generation (not sure when/how), so I guess the remote should be set. See also gajus/gitdown#57 for an open issue.

@kraenhansen
Copy link
Contributor Author

kraenhansen commented May 2, 2023

Thanks - this solved it for me.
Feel free to close this issue or leave it open, as it did cause some confusion and would probably be good to find a more permanent solution for.

Somewhat (but not really) related, I found that "master" was mentioned in the failing script:

defaultBranchName: getSomeBranch() || 'master',

It's probably leftover from a rename of the default branch.

@brettz9
Copy link
Collaborator

brettz9 commented May 2, 2023

Good to hear. I think those interested can track a possible fix at gajus/gitdown#57 .

@brettz9 brettz9 closed this as completed May 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants