From 5d8e0128997aa6303aab5aa411479b4f26d46e9e Mon Sep 17 00:00:00 2001 From: Parker Moore Date: Wed, 20 Feb 2013 23:10:42 +0100 Subject: [PATCH] Fixed merge with new log output in lib/jekyll.rb --- lib/jekyll.rb | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/lib/jekyll.rb b/lib/jekyll.rb index b2ef5ad1..a669c911 100644 --- a/lib/jekyll.rb +++ b/lib/jekyll.rb @@ -133,16 +133,17 @@ module Jekyll config_file = File.join(source, '_config.yml') begin config = YAML.safe_load_file(config_file) - raise "Invalid configuration file: #{config_file}" if !config.is_a?(Hash) - $stdout.puts "Configuration file: #{config_file}" + raise "Configuration file: (INVALID) #{config_file}" if !config.is_a?(Hash) + $stdout.puts "Configuration file: #{config_file}" + rescue SystemCallError + # Errno:ENOENT = file not found + $stderr.puts "Configuration file: none" + config = {} rescue => err - unless File.exists?(config_file) - $stdout.puts "Configuration file: none" - else - $stderr.puts "WARNING: Could not read configuration. " + - "Using defaults (and options)." - $stderr.puts "\t" + err.to_s - end + $stderr.puts " " + + "WARNING: Error reading configuration. " + + "Using defaults (and options)." + $stderr.puts "#{err}" config = {} end