I am creating an extension for simple git commands, and when a user enters a command in the Command Palette, like Init
, I want to call git init
on their current directory.
Unfortunately, there is no documentation on executing code locally with the VSCode extensions API. Is there any way to do this?
Yes, this is possible, by using child_process.spawn. I have used it in my extension to run a Java jar. The core of the execution is shown here: