Normally we just want to copy the pre-build assets that are checked into the mocha and chai repositories.
…acha with the Rake task 'server'.
When you move around with git, sometimes the target files need rebuilding but have up-to-date timestamps, so we clean first to force a rebuild. --always-make is a GNU option, so we cannot use it. We cannot use a single make invocation (make clean mocha.js), since MAKEFLAGS=-j2 in the environment can cause race conditions. Oh the joy of make.
This way we will stay on any submodule branch we checked out (like master). There does not seem to be a "init & update unless already initialized" command for `git submodule`, so we check with File.exist?.
Practicing what I preach in http://www.solitr.com/blog/2012/04/contributor-friendly-gems/