Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I can run pear/phpunit from "cmd" just fine. I checked %PATH% and everything that is there is also in $PATH.

To be clear, this is not msysgit -- It is this:
http://git-scm.com/downloads

Anyone know how I can make it get recognized?

Thanks!

share|improve this question
    
How are you invoking it and what is the actual error message you're receiving? –  Oliver Salzburg Jul 5 '13 at 15:20
    
typing in "pear" and "phpunit" from Git Bash -- like I do in "cmd". It was working on a Windows XP computer (which I don't have access to at the moment). Error: sh.exe": pear: command not found –  Kerry Jul 5 '13 at 15:30
    
@Kerry, just to clarify, the versions of git found here git-scm.com and here msysgit.github.io are the same build. There's no difference. What you linked is the same as Msysgit. –  DanteTheEgregore Oct 18 '13 at 20:46

1 Answer 1

up vote 1 down vote accepted

I found that the problem was not in fact with the PATH (which was matching my Windows path perfectly). The problem is that Git Bash does not run ".bat" files:
http://code.google.com/p/msysgit/issues/detail?id=426

To run a batch file you have to do a work around:

cmd "/c /path/to/batch.bat"

Reference:
http://stackoverflow.com/questions/11865085/out-of-a-git-console-how-do-i-execute-a-batch-file-and-then-return-to-git-conso

The solution in my case was to make an alias for phpunit in my .bash_profile file:

alias phpunit='cmd "/c phpunit.bat"'

Hope that helps anyone else with the same problem.


UPDATE

I discovered that if you want to use arguments (such as specific a specific file to test) you will need to change what you put in your .bash_profile to the following:

function __phpunit {                                                                
    cmd "/c phpunit.bat $@"  
} 

alias phpunit=__phpunit
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.