BUGFIX: if uploads is in a symlinked directory stuff breaks

This commit is contained in:
Sam 2014-03-07 19:16:32 +11:00
parent b91eb8ed38
commit 894bb0716c
1 changed files with 8 additions and 1 deletions

View File

@ -153,7 +153,14 @@ class SiteCustomization < ActiveRecord::Base
[[:desktop, 'stylesheet_baked'], [:mobile, 'mobile_stylesheet_baked']].each do |target, baked_attr|
path = stylesheet_fullpath(target)
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)
File.open(path, "w") do |f|
f.puts self.send(baked_attr)