Running script via custom action on Source Tree Windows
Asked by oheckel:

I didn't get it on working

image2015-1-23 17:0:14.png

image2015-1-23 17:0:59.png

the Script file works correct when i start it over the Windows command promt.

Oli  
[](https://community.atlassian.com/t5/Sourcetree-questions/Running-script-via-custom-action-on-Source-Tree-Windows/qaq-p/375824?attachment-id=10654){#link_116aa33ec09cf9}  
[](/tnckb94959/attachments/tnckb94959/sourcetree-questions/11159/1/image2015-1-23%2016%3A58%3A16.png){#display_116aa33ec09cf9_0}  
[](https://community.atlassian.com/t5/Sourcetree-questions/Running-script-via-custom-action-on-Source-Tree-Windows/qaq-p/375824?attachment-id=10655){#link_116aa33ec09cf9_0}  
[](/tnckb94959/attachments/tnckb94959/sourcetree-questions/11159/2/image2015-1-23%2017%3A0%3A59.png){#display_116aa33ec09cf9_2}  
[](https://community.atlassian.com/t5/Sourcetree-questions/Running-script-via-custom-action-on-Source-Tree-Windows/qaq-p/375824?attachment-id=10656){#link_116aa33ec09cf9_1}  
[](/tnckb94959/attachments/tnckb94959/sourcetree-questions/11159/3/image2015-1-23%2017%3A0%3A14.png){#display_116aa33ec09cf9_4}


Answers:
author: Seth
body: I am guessing the problem here is that .sh files are not directly supported by Windows (.bat files are).

When you run that from the command line, is that a standard command line window, or one that's running cygwin? Try putting a specific command to run the file in front of it, like "sh start_project.sh ...".


author: oheckel
body: Cool thanks it works i changed my "Custom Action" into

image2015-1-26 16:35:24.png

and now it works...  
[](https://community.atlassian.com/t5/Sourcetree-questions/Running-script-via-custom-action-on-Source-Tree-Windows/qaq-p/375824?attachment-id=12295){#link_116aa34638c803}  
[](/tnckb94959/attachments/tnckb94959/sourcetree-questions/11163/1/image2015-1-26%2016%3A35%3A24.png){#display_116aa34638c803_0}


author: falloonalan
body: I can launch .sh scripts by using the full path in a bat file. So the work around for me was a bat file like this

C:\\\<Pathtoyourscripit\>\\PruneTags.sh


author: maxou6631
body: Hello,

I'am learning about git and sourcetree, I tried to make a custom action to send the command plotgitsch -ifirefox to see the imaging diff about kicad shematic.

Could you tell me more how to create the script and how can I link this script with the custom action..

I tried this on command bash it works fine, but when I define the custom actions it is not working.![Working bash.PNG](https://community.atlassian.com/t5/image/serverpage/image-id/132189i542C3AB0057D3429/image-size/large?v=v2&px=999 "Working bash.PNG")

![sourcetree fail1.PNG](https://community.atlassian.com/t5/image/serverpage/image-id/132187i6B8D80F4BA75D6F0/image-size/large?v=v2&px=999 "sourcetree fail1.PNG")

Could you help me please?

Thanks a lot.

Maxime.


author: oheckel
body: No the Script isn't doing anything. Is seems to be that sc scripts doesn't work with Source tree for Windows or I'am doing something fundamentally wrong. So I also tried other scripts and got the same result.


author: Seth
body: Is it possible that the script is doing what it is supposed to, but returning some sort of error code that you can't see when executing directly from the command line?