Empty output in Deno.Command
I’m trying to run the command
git log —grep='.'
from Deno. However, it always returns an empty output.
If I delete the grep
option it returns it fine. Running the same command from the CLI returns all commits.
It’s weird because other “similarly looking options” seem to work fine for example —format
.
2 Replies
Okay, without the single quotes like
"—grep=."
it works. However, this leaves the question how to use it with more patterns like containing spaces?
Okay, separating the value to the —grep
option into a separate argument like … "—grep", ".", …
fixed it.
Funnily, this does not work with the similarly looking —format
argument.@vwkd Have you tried "--format", "%h %s"? Since it is an array of arguments, you shouldn't need to enclose arguments with space in quotes - as long as you don't do anything funky, like pass a command as an argument to a command.