I'm writing a batch file that runs a command via git-cmd.exe
but it doesn't run the command(s) after it.
I've tried to use CALL
, START /WAIT
, and START /B /WAIT
. All have the same behavior. Maybe there is a parameter should be sent to git-cmd.exe
to execute the command and exit but I didn't find any guide explaining how to use git-cmd.exe
.
This is a sample batch file:
@ECHO OFF
SET "PATH=C:\Ruby26-x64\bin;C:\Program Files\nodejs;%PATH%"
SET "CurrentDirectory=%CD%"
CD /D "%UserProfile%\AppData\Local\GitHub\PortableGit_*\"
SET "GitDirectory=%CD%"
CD /D "%CurrentDirectory%"
"%GitDirectory%/git-cmd.exe" CALL rake build
PAUSE
The command passed to git-cmd.exe
is executed but the PAUSE
command doesn't execute until I type EXIT
command manually in the 'Command Prompt' window.
I've also tried a simple DIR
command instead of rake build
but the same issue still occurs:
"%GitDirectory%/git-cmd.exe" DIR
PAUSE