expand_path on custom source directories. Fixes #1823
This commit is contained in:
parent
7b59f240d5
commit
737e6f5e64
|
@ -116,7 +116,8 @@ module Middleman
|
|||
Contract Or[Symbol, HANDLER], Maybe[Hash] => HANDLER
|
||||
def watch(type_or_handler, options={})
|
||||
handler = if type_or_handler.is_a? Symbol
|
||||
SourceWatcher.new(self, type_or_handler, options.delete(:path), options)
|
||||
path = File.expand_path(options.delete(:path), app.root)
|
||||
SourceWatcher.new(self, type_or_handler, path, options)
|
||||
else
|
||||
type_or_handler
|
||||
end
|
||||
|
|
|
@ -92,7 +92,7 @@ module Middleman
|
|||
# @return [void]
|
||||
Contract String => Any
|
||||
def update_path(directory)
|
||||
@directory = Pathname(directory)
|
||||
@directory = Pathname(File.expand_path(directory, app.root))
|
||||
|
||||
stop_listener! if @listener
|
||||
|
||||
|
@ -133,6 +133,7 @@ module Middleman
|
|||
return nil if p.absolute? && !p.to_s.start_with?(@directory.to_s)
|
||||
|
||||
p = @directory + p if p.relative?
|
||||
|
||||
if glob
|
||||
@extensionless_files[p]
|
||||
else
|
||||
|
|
Loading…
Reference in a new issue