Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Custom Action Command Prompt

Cameron Gocke September 23, 2016

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.

 

1 answer

1 vote
QwazyWabbit
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 23, 2016

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. 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events