Repository navigation
chore: Remove Pify dependency - #465
Conversation
| ], | ||
| choices: choices, | ||
| when: !argv._[0], | ||
| default: 0, |
There was a problem hiding this comment.
If you dont specify the default value, the hint shows (0) and not (add)
| "commit": false, | ||
| "contributorsPerLine": 6, | ||
| "linkToUsage": true, | ||
| "files": [ |
There was a problem hiding this comment.
Just linting in this whole file
| @@ -0,0 +1,159 @@ | |||
| import {test, expect, vi, describe, beforeEach} from 'vitest' | |||
There was a problem hiding this comment.
Added tests for this functionality to ensure nothing broke / doesnt break going forward
| @@ -0,0 +1,66 @@ | |||
| import {test, expect, describe} from 'vitest' | |||
There was a problem hiding this comment.
Just moved the tests from the separate files. Now the test file matches the src file naming convention
|
@lwasser Let me know if there are any additional things you want to validate before merging this badboy |
lwasser
left a comment
There was a problem hiding this comment.
Thank you @jdalrymple for this!! there is some great cleanup here and reorg + new tests are also welcome!! let's merge this. My apologies, i started testing this the other day and then forgot to complete my review.
Since all-contributors#465, spawnGitCommand has joined its arguments into one string and run it through a shell. The commit message was split on spaces, so `all-contributors add` failed with `pathspec` errors when `commit` was enabled. Paths containing spaces broke `git add` the same way, and shell metacharacters in a username or commit template were executed. Pass the arguments to execFile so each one reaches git intact. Fixes all-contributors#587 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Since all-contributors#465, spawnGitCommand has joined its arguments into one string and run it through a shell. The commit message was split on spaces, so `all-contributors add` failed with `pathspec` errors when `commit` was enabled. Paths containing spaces broke `git add` the same way, and shell metacharacters in a username or commit template were executed. Pass the arguments to execFile so each one reaches git intact. Fixes all-contributors#587 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Since all-contributors#465, spawnGitCommand has joined its arguments into one string and run it through a shell. The commit message was split on spaces, so `all-contributors add` failed with `pathspec` errors when `commit` was enabled. Paths containing spaces broke `git add` the same way, and shell metacharacters in a username or commit template were executed. Pass the arguments to execFile so each one reaches git intact. Fixes all-contributors#587 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
<!-- Thanks for your interest in the project. Bugs filed and PRs submitted are appreciated! Please make sure that you are familiar with and follow the Code of Conduct for this project (found in the CODE_OF_CONDUCT.md file). Also, please make sure you're familiar with and follow the instructions in the contributing guidelines (found in the CONTRIBUTING.md file). If you're new to contributing to open source projects, you might find this free video course helpful: http://kcd.im/pull-request Please fill out the information below to expedite the review and (hopefully) merge of your pull request! --> <!-- What changes are being made? (What feature/bug is being fixed here?) --> **What**: Fixes #587: With `"commit": true`, `all-contributors add` fails at the commit step with `pathspec` errors, leaving the files staged but not committed. <!-- Why are these changes necessary? --> **Why**: This is a regression from #465. `spawnGitCommand` joins its arguments into one string and runs it through a shell, which causes three problems: - The commit message is split on spaces, so only the first word is used as the message and the rest are treated as pathspecs. - `git add` fails when the project path contains a space. - Shell metacharacters in a username or commit template are executed. Usernames aren't escaped because `autoEscape` is off (in src/util/template.js). (Confirmed this on Windows with `&`, did not test it on a POSIX shell) <!-- How were these changes implemented? --> **How**: - `spawnGitCommand` now uses `execFile('git', args)`, so each argument reaches git intact with no shell involved. - `getRemoteOriginData` still uses `exec`, since its command is just a fixed string. - The existing tests asserted the broken joined string, so they now expect an argument array. - Added regression tests to test/e2e/cli.test.js. They run add octocat doc --commit in a temporary git repo whose path contains a space, and check that the commit gets the whole message and that shell metacharacters in the message are not executed. Both tests fail without the fix. I also ran the reproduction steps from the issue using the fixed CLI, and confirmed the fix works. <!-- Have you done all of these things? --> **Checklist**: <!-- add "N/A" to the end of each line that's irrelevant to your changes --> <!-- to check an item, place an "x" in the box like so: "- [x] Documentation" --> - [ ] Documentation N/A - [x] Tests - [x] Ready to be merged <!-- In your opinion, is this ready to be merged as soon as it's reviewed? --> - [ ] Added myself to contributors table <!-- this is optional, see the contributing guidelines for instructions --> <!-- feel free to add additional comments --> --------- Co-authored-by: geniosoy <nstchigel@gmail.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
What: Removing pify dependency
Additionally:
Why: Native node supports promisified functions
How: Convert from one to the other
Checklist: