Permalink
Browse files

Always clean when rebuilding assets

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.
  • Loading branch information...
1 parent 22ce1f3 commit 59808c160019d24c8acac526dc754a35c1103001 @joliss joliss committed May 11, 2012
Showing with 2 additions and 2 deletions.
  1. +2 −2 Rakefile
View
@@ -8,8 +8,8 @@ RSpec::Core::RakeTask.new :spec
desc 'Build and copy Mocha and Chai assets from submodules into vendor/assets'
task :assets do
sh 'git submodule update --init' unless File.exist?('mocha/Makefile') || File.exist?('chai/Makefile')
- sh 'cd mocha && make -s'
- sh 'cd chai && make -s'
+ sh 'cd mocha && make clean && make'
+ sh 'cd chai && make clean && make'
mkdir_p 'vendor/assets/javascripts'
mkdir_p 'vendor/assets/stylesheets'
cp 'mocha/mocha.js', 'vendor/assets/javascripts/'

0 comments on commit 59808c1

Please sign in to comment.