capistrano-plugins / capistrano-faster-assets

Skips asset compilation if none of the assets were changed since last release.
MIT License
186 stars 38 forks source link

Error appears while assets are copied #12

Open SmyzerT opened 9 years ago

SmyzerT commented 9 years ago

this https://github.com/capistrano-plugins/capistrano-faster-assets/blob/master/lib/capistrano/tasks/faster_assets.rake#L45 triggers error, because capistrano/rails creates symlink to public/assets and the task creates endless loop copy

rhomeister commented 9 years ago

I've never seen this problem before. Do you have an idea why this is happening in your specific case?

SmyzerT commented 9 years ago

I think in my case it happens because capistrano/rails creates a symlink release/timestamp/public/assets -> shared/public/assets, so previous release and current release refers to the same assets folder. I think that we don't need to execute a line which invoke assets copying, because we have symlink to the right assets and we just need to invoke copying if we don't have any symlink (but we have the symlink because this gem depends to capistrano/rails which creates the symlink)

off topic note

I think it would be better to add capistrano/rails as dependency to your gem via http://guides.rubygems.org/specification-reference/#add_runtime_dependency and create some rake task like rake faster-assets install which will automatically add required line into the Capfile

rhomeister commented 9 years ago

Strangely enough, I have never experienced this problem, and I'm also using capistrano-rails. So I'm trying to figure out what is going wrong in your specific case.

On 28 October 2015 at 09:15, SmyzerT notifications@github.com wrote:

I think in my case it happens because capistrano/rails creates a symlink release/timestamp/public/assets -> shared/public/assets, so previous release and current release refers to the same assets folder. I think that we don't need to execute a line which invoke assets copying, because we have symlink to the right assets and we just need to invoke copying if we don't have any symlink (but we have the symlink because this gem depends to capistrano/rails which creates the symlink) off topic note

I think it would be better to add capistrano/rails as dependency to your gem via http://guides.rubygems.org/specification-reference/#add_runtime_dependency and create some rake task like rake faster-assets install which will automatically add required line into the Capfile

— Reply to this email directly or view it on GitHub https://github.com/capistrano-plugins/capistrano-faster-assets/issues/12#issuecomment-151759917 .

elik-ru commented 8 years ago

I confirm the same problem

Problem line is here:

execute(:cp, '-r', latest_release_path.join('public', fetch(:assets_prefix)), release_path.join('public', fetch(:assets_prefix)))

because both paths are symlinks to shared/public/assets