mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-23 23:58:31 -05:00
BUGFIX: if uploads is in a symlinked directory stuff breaks
This commit is contained in:
parent
b91eb8ed38
commit
894bb0716c
1 changed files with 8 additions and 1 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue