Commit de2d0cdd authored by azul's avatar azul

fix: follow symlinks to find dir for theme

parent b267a7e3
......@@ -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