Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
polarlights committed Apr 4, 2016
1 parent 162889e commit 9fa49ee
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions lib/capistrano/tasks/faster_assets.rake
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,17 @@ namespace :deploy do

info("Skipping asset precompile, no asset diff found")

# copy over all of the assets from the last release
execute(:cp, '-r', latest_release_path.join('public', fetch(:assets_prefix)), release_path.join('public', fetch(:assets_prefix)))
release_asset_path = release_path.join('public', fetch(:assets_prefix))
# skip if assets directory is symlink
begin
execute(:test, '-L', release_asset_path.to_s)
rescue
# copy over all of the assets from the last release
execute(:cp, '-r', latest_release_path.join('public', fetch(:assets_prefix)), release_asset_path.parent)
end

# copy assets if manifest file is not exist (this is first deploy after using symlink)
execute(:ls, release_asset_path.join('manifest*')) rescue raise(PrecompileRequired)
rescue PrecompileRequired
execute(:rake, "assets:precompile")
end
Expand Down

0 comments on commit 9fa49ee

Please sign in to comment.