I'm trying to create a custom action to open a command prompt to a given repository's working directory. (I'm in Windows.)
I created a custom action with this script:
C:\Windows\System32\cmd.exe
And these parameters:
/k pushd $REPO
When I launch I can see the command executed like this:
cmd.exe /k pushd C:\Users\CameronGocke\Git\api-portal
SourceTree; however, just spins and never launches the command prompt, whereas if I run the command directly I get what I'd expect to see.
Update:
The response from @Geoff Joy seems to be on the right track in terms of the cause, but it is still not working properly. SourceTree still waits for the process and all child processes to finish before it returns. I have 2 scripts created for custom actions that both behave the same way. The other is to launch VS Code and looks like this:
start "" "C:\Program Files (x86)\Microsoft VS Code\Code.exe" "%1"
exit
Though the script ends, SourceTree continues spinning until VS Code is closed and then control returns to SourceTree.
Add an exit command to your script. SourceTree wants to see the CMD process close. If the window stays open there's no closure of the custom command. Exit 0 ought to do it.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.