-
-
Notifications
You must be signed in to change notification settings - Fork 313
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
git.grep
and pathspec
not working as expected
#914
Comments
git.grep
and pathspec not working as expectedgit.grep
and pathspec
not working as expected
Hello, please can you include the code you are using to generate the arguments - is this through the |
@steveukx I have tried both these variants, but both lead to the same problem of arguments order:
|
Apologies for the delay, but thank you for the detail in the issue. From the next release, which will be this week, you will be able to use a import {pathspec, simpleGit} from 'simple-git'
const grepResultsPds = await git.grep('<Pds::', ['--ignore-case', pathspec('*.hbs')]); |
@steveukx thank you for the fix (I see the same issue with the command |
Hi @didoo the changes are now live in 3.19.0 and should "just work" in any task that allowed a trailing |
@steveukx tested now, and works like a charm! Thank you for the fix 🙏 |
issue
If a
pathspec
option is provided to thegit.grep
command, it's not appended as last option per official documentation but it appears before the-e
option, which causesgit
to fail:I tried different alternatives to provide the arguments, to bypass the problem, but none of them worked. Looking at the source code, my understanding is that the
-e
option is always appendend (but this should not be the case if apathspec
argument is provided).Any idea if there is a workaround? Should this be considered a bug? I may try to open a PR, if there's no alternatives, but since I'm new to this codebase I would prefer to be sure that my understanding of the problem is correct.
The text was updated successfully, but these errors were encountered: