parent
f606d9339b
commit
bec4a07c12
|
@ -63,11 +63,7 @@ module Jekyll
|
|||
#
|
||||
# Returns nothing.
|
||||
def setup
|
||||
# Check that the destination dir isn't the source dir or a directory
|
||||
# parent to the source dir.
|
||||
if self.source =~ /^#{self.dest}/
|
||||
raise FatalException.new "Destination directory cannot be or contain the Source directory."
|
||||
end
|
||||
ensure_not_in_dest
|
||||
|
||||
# If safe mode is off, load in any Ruby files under the plugins
|
||||
# directory.
|
||||
|
@ -83,6 +79,17 @@ module Jekyll
|
|||
self.generators = instantiate_subclasses(Jekyll::Generator)
|
||||
end
|
||||
|
||||
# Check that the destination dir isn't the source dir or a directory
|
||||
# parent to the source dir.
|
||||
def ensure_not_in_dest
|
||||
dest = Pathname.new(self.dest)
|
||||
Pathname.new(self.source).ascend do |path|
|
||||
if path == dest
|
||||
raise FatalException.new "Destination directory cannot be or contain the Source directory."
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
# Internal: Setup the plugin search path
|
||||
#
|
||||
# Returns an Array of plugin search paths
|
||||
|
|
Loading…
Reference in New Issue