BUGFIX: if uploads is in a symlinked directory stuff breaks
This commit is contained in:
parent
b91eb8ed38
commit
894bb0716c
|
@ -153,7 +153,14 @@ class SiteCustomization < ActiveRecord::Base
|
||||||
[[:desktop, 'stylesheet_baked'], [:mobile, 'mobile_stylesheet_baked']].each do |target, baked_attr|
|
[[:desktop, 'stylesheet_baked'], [:mobile, 'mobile_stylesheet_baked']].each do |target, baked_attr|
|
||||||
path = stylesheet_fullpath(target)
|
path = stylesheet_fullpath(target)
|
||||||
dir = cache_fullpath
|
dir = cache_fullpath
|
||||||
FileUtils.mkdir_p(dir)
|
|
||||||
|
begin
|
||||||
|
FileUtils.mkdir_p(dir)
|
||||||
|
rescue
|
||||||
|
# subtle issue, this happens if "uploads" is a symlink
|
||||||
|
Errno::EEXIST
|
||||||
|
end
|
||||||
|
|
||||||
unless File.exists?(path)
|
unless File.exists?(path)
|
||||||
File.open(path, "w") do |f|
|
File.open(path, "w") do |f|
|
||||||
f.puts self.send(baked_attr)
|
f.puts self.send(baked_attr)
|
||||||
|
|
Loading…
Reference in New Issue