Permalink
Browse files

Using default config if config passed is either empty or null

  • Loading branch information...
parkr committed Jan 2, 2013
1 parent d0e2a0a commit ac9a541401c74b93f6c8b62fb154d34f2f1bc0aa
Showing with 4 additions and 2 deletions.
  1. +4 −2 lib/jekyll.rb
View
@@ -124,8 +124,10 @@ def self.configuration(override)
# then, we need to know where to look for _config.yml
source = override['source'] || Jekyll::DEFAULTS['source']
- # Get configuration from <source>/_config.yml
- config_file = override['config'] || File.join(source, '_config.yml')
+ # Get configuration from <source>/_config.yml or <source>/<config_file

This comment has been minimized.

Show comment Hide comment
@mattr-

mattr- Jan 16, 2013

Member

missing a > here at the end of the line.

@mattr-

mattr- Jan 16, 2013

Member

missing a > here at the end of the line.

+ config_file = override.delete('config')
+ config_file = File.join(source, "_config.yml") if config_file.to_s.empty?
+
begin
config = YAML.load_file(config_file)
raise "Invalid configuration - #{config_file}" if !config.is_a?(Hash)

0 comments on commit ac9a541

Please sign in to comment.