Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added a recipe to precompile for capistrano

  • Loading branch information...
commit fc40a7a5b9090ef5447a624113a196e3b3c463b7 1 parent 4a58fa6
Michael Schaefermeyer authored
Showing with 16 additions and 0 deletions.
  1. +15 −0 lib/smart_asset/recipes.rb
  2. +1 −0  recipes/smart_asset.rb
View
15 lib/smart_asset/recipes.rb
@@ -0,0 +1,15 @@
+require File.join File.dirname(__FILE__),'..','smart_asset'
+Capistrano::Configuration.instance(:must_exist).load do
+ namespace :smart_asset do
+
+ desc 'Precompile assets for deploys'
+ task :precompile do
+ destination = SmartAsset.load_config(Dir.pwd) && SmartAsset.dest
+ run_locally "smart_asset"
+ return unless scm == :git
+ run_locally "git ls-files -d #{destination['javascripts']} #{destination['stylesheets']} | xargs git rm"
+ run_locally "git add #{destination['javascripts']} #{destination['stylesheets']}"
+ run_locally "git commit -m 'autocommit: smart_asset'"
+ end
+ end
+end
View
1  recipes/smart_asset.rb
@@ -0,0 +1 @@
+require File.join File.dirname(__FILE__),'..','lib','smart_asset','recipes'
Please sign in to comment.
Something went wrong with that request. Please try again.