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
|
Contract Or[Symbol, HANDLER], Maybe[Hash] => HANDLER
|
||||||
def watch(type_or_handler, options={})
|
def watch(type_or_handler, options={})
|
||||||
handler = if type_or_handler.is_a? Symbol
|
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
|
else
|
||||||
type_or_handler
|
type_or_handler
|
||||||
end
|
end
|
||||||
|
|
|
@ -92,7 +92,7 @@ module Middleman
|
||||||
# @return [void]
|
# @return [void]
|
||||||
Contract String => Any
|
Contract String => Any
|
||||||
def update_path(directory)
|
def update_path(directory)
|
||||||
@directory = Pathname(directory)
|
@directory = Pathname(File.expand_path(directory, app.root))
|
||||||
|
|
||||||
stop_listener! if @listener
|
stop_listener! if @listener
|
||||||
|
|
||||||
|
@ -133,6 +133,7 @@ module Middleman
|
||||||
return nil if p.absolute? && !p.to_s.start_with?(@directory.to_s)
|
return nil if p.absolute? && !p.to_s.start_with?(@directory.to_s)
|
||||||
|
|
||||||
p = @directory + p if p.relative?
|
p = @directory + p if p.relative?
|
||||||
|
|
||||||
if glob
|
if glob
|
||||||
@extensionless_files[p]
|
@extensionless_files[p]
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in a new issue