Commit 76f0163c authored by azul's avatar azul

Merge branch 'fix-symlink-issue-in-production' into 'master'

fix: follow symlinks to find dir for theme

See merge request !278
parents b267a7e3 de2d0cdd
......@@ -217,9 +217,10 @@ module Crabgrass::Theme::Loader
# ensures the directory exists
def ensure_dir(dir)
FileUtils.mkdir_p(dir) unless File.exist?(dir)
unless File.directory?(dir)
raise format('For the theme to work, "%s" must be a directory.', dir)
resolved = File.symlink?(dir) ? File.readlink(dir) : dir
FileUtils.mkdir_p(resolved) unless File.exist?(resolved)
unless File.directory?(resolved)
raise format('For the theme to work, "%s" must be a directory.', resolved)
end
end
end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment