-
Notifications
You must be signed in to change notification settings - Fork 216
Unable to send pull requests (and peerDependencies errors) #745
Comments
@julien thanks for reporting this. We added a feature recently to open your editor when you omit Here are some workarounds until we can solve this better: In your OR
OR add the title and description
OR make your We should probably list these options instead of a fatal error. |
Thanks for the quick reply @protoEvangelion. I'll add As an example const fs = require("fs");
const os = require("os");
const path = require("path");
fs.writeFile(
path.join(os.tmpdir(), "foo.txt"),
"This is some text ...\n",
err => { err && console.error(err) }
); Works fine on this machine (the file The fact that it's JS doesn't really matter, this could be a bash script or a compiled C program and it would have the same result. |
Thanks for the extra info @julien that helps a lot as I can't repro on my machine! Could you replace https://github.com/node-gh/gh/blob/master/src/utils.ts#L78 with If you don't want to build the project you can just find that line and replace it in your node_modules in the utils.js file: |
Hey @protoEvangelion, Thanks, I think your solution needs some modifications, but it's pretty easy to fix ${os.tmpdir()}-${filename} Is going to return something like
Which is not what you want (notice the I usually use the In my case I used: path.join(os.tmpdir(), fileName); Just make sure both The second thing that was failing was getting the "editor". The program tries to get the editor with: const editor = exec.spawnSync('git', ['config', '--global', 'core.editor']).stdout; In my case (I try to add the bare minimum configuration) git config --global core.editor Doesn't return anything. I usually don't set it and rely on programs to be "smart" enough to read But once I configured that, it worked. I'd still try to read |
Awesome suggestions @julien 🎉 Thank you again for the extra details & ideas. I will give that a try unless you would like to send a PR for it 😄 |
@protoEvangelion I actually have the pull request ready. One of the tests is failing right now. I saw this but I'm not really sure what to do about it. Is there any way to configure this? I don't really feel like adding my username and password to make tests pass. |
To determine which editor to use for commit messages look if $EDITOR or $VISUAL are set in the environment before checking the git config. If no editor is found throw an error. Fixes node-gh#745
@protoEvangelion it's ok I figured what was going on. |
@all-contributors please add @julien for bug,code |
I couldn't determine any contributions to add, did you specify any contributions? |
@all-contributors please add @julien for bug code |
I've put up a pull request to add @julien! 🎉 |
To determine which editor to use for commit messages look if $EDITOR or $VISUAL are set in the environment before checking the git config. If no editor is found throw an error. Fixes #745
🎉 This issue has been resolved in version 2.8.3 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Version number
2.8.1
Describe the bug
After installing the package via
npm i -g gh
A warning is shown
When trying to run
gh pr -s SOME_GITHUB_USERNAME
an error is thrown(Obviously SOME_GITHUB_USERNAME is a real username on GitHub, I just didn't want to include it in the bug report for privacy reasons.)
To Reproduce
Please see description above
Expected behavior
I expect this package to work as intended,
gh pr -s SOME_GITHUB_USERNAME
should submit the pull request to SOME_GITHUB_USERNAME on Github.Screenshots
Additional context
The text was updated successfully, but these errors were encountered: