views:

109

answers:

0

Alright all you little geniuses you.. please help. :D

I have written a Capistrano recipe to remove the all.js cached javascript file and tell the server to restart, but it still doesn't work right. And inevitably I have to go, manually delete the all.js file and then manually restart apache. (touching restart.txt doesn't always work)

Anybody have a working solution to this problem?

Here is the current recipe:

desc "Package Javascripts"  
    task :package_javascripts, :roles => :web do
      sudo %{rm -f #{current_path}/public/javascripts/all.js}
      javascripts.each do |javascript|
        run %{/usr/bin/ruby #{current_path}/lib/jsmin.rb < \
              #{current_path}/public/javascripts/#{javascript}.js >> \
              #{current_path}/public/javascripts/all.js}
      end
      run "touch #{current_path}/tmp/restart.txt"
    end