-
Hi, I am trying to execute a grep command with regex using the execute() function. A part of my code is:
I am getting the following error:
However, when I run I appreciate any help. |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments
-
It’s unlikely git is executed in the correct directory, which is why one would rather instantiate a Docs for how to invoke git, and here for the troubleshooting. Please feel free to keep posting into the closed issue for follow ups. |
Beta Was this translation helpful? Give feedback.
-
Thanks for the response.
|
Beta Was this translation helpful? Give feedback.
-
The issue is resolved by removing Another issue comes up now. If the result of executing Any ideas to solve this? |
Beta Was this translation helpful? Give feedback.
-
By the looks of it, there is no way to ignore a non-zero exit code nor does git grep allow to ignore empty results. As you are effectively executing the git program, maybe it’s easiest to call git yourself. |
Beta Was this translation helpful? Give feedback.
The issue is resolved by removing
\"
from the"\"config.isEnabled([[:space:]*]'" + item + "'[[:space:]*])\""
.Another issue comes up now. If the result of executing
grep
function is empty, I am getting the same errorGitCommandError: Cmd('git') failed due to: exit code(1)
. When there is any result, it works fine.Any ideas to solve this?