Skip to content

Commit

Permalink
Merge pull request #200 from capistrano/avoid-double-symlink-of-public
Browse files Browse the repository at this point in the history
Don't link public/assets if public is linked
  • Loading branch information
mattbrictson committed Mar 4, 2017
2 parents 2232734 + 3203981 commit 8334fcc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# [master][]

* Your contribution here!
* [#200](https://github.com/capistrano/rails/pull/200): Don't link public/assets if public is already linked - [@mattbrictson](https://github.com/mattbrictson)

# [1.2.2][] (Jan 10 2017)

Expand Down
6 changes: 5 additions & 1 deletion lib/capistrano/tasks/assets.rake
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,11 @@ end
# as assets_prefix will always have a default value
namespace :deploy do
task :set_linked_dirs do
set :linked_dirs, fetch(:linked_dirs, []).push("public/#{fetch(:assets_prefix)}").uniq
linked_dirs = fetch(:linked_dirs, [])
unless linked_dirs.include?('public')
linked_dirs << "public/#{fetch(:assets_prefix)}"
set :linked_dirs, linked_dirs.uniq
end
end
end

Expand Down

0 comments on commit 8334fcc

Please sign in to comment.