Custom Action Fails

I've added a custom action that simply calls a shell script. However, when I run it, it fails. Here is the fail message:

prep_submodule.sh /Git/CFTools

2013-04-01 15:45:31.082 SourceTree[4126:203] *** NSTask: Task create for path '/Git/CFTools/Scripts/git/prep_submodule.sh' failed: 22, "Invalid argument". Terminating temporary process.

Completed with errors, see above

As you can see, I'm also passing $REPO to the script. The script simply says:

echo $1

I assume the script is just called with $REPO as the first parameter (second if you include $0)

Am I doing something wrong or is this a bug?

2 answers

1 accepted

Hi Jason,

There's two issues here. The first is the one you're describing seems to think the path doesn't exist. I'd do things in this order

  1. At the terminal in the directory you so wish, type "touch prep_submodule.sh"
  2. Then at the terminal type "chmod +x prep_submodule.sh"
  3. In the file make sure you've got the shebang in it, so the first line should have "#!/bin/sh". Check this wiki entry for more details.
  4. In SourceTree make sure the Custom Action sheet has the correct path set (i.e. make sure you can 'cd' to it from the terminal)

I just had a try myself to see if I could get your set up to work and it was fine.

Let us know if you need any more help.

Cheers

Kieran, thanks for answering. My initial setup was very much as you have said. I accidentally type #!/usr/sh. I changed it to #!/bin/sh and it worked. Thanks!

Thanks Kieran and Jason, I was trying to run a shell command from Adobe AIR and I failed. Then I seen this discussion and I added #!/bin/sh as mentioned above to my .sh file and it worked. :)

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted Tuesday in United States

Topic Tuesday: What's your favorite topic?

Good morning All, Our goal is to get you into the habit of while enjoying your favorite morning drink you are checking the NOVA "space" for topics and comments. Your input is really needed and...

61 views 4 0
View post

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you