Fixed merge with new log output in lib/jekyll.rb

This commit is contained in:
Parker Moore 2013-02-20 23:09:34 +01:00
parent 388e0c8077
commit bf79b0ac37
2 changed files with 13 additions and 7 deletions

View File

@ -133,12 +133,16 @@ module Jekyll
config_file = File.join(source, '_config.yml')
begin
config = YAML.safe_load_file(config_file)
raise "Invalid configuration - #{config_file}" if !config.is_a?(Hash)
$stdout.puts "Configuration from #{config_file}"
raise "Invalid configuration file: #{config_file}" if !config.is_a?(Hash)
$stdout.puts "Configuration file: #{config_file}"
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
config = {}
end

View File

@ -23,7 +23,9 @@ module Jekyll
def self.build(site, options)
source = options['source']
destination = options['destination']
puts "Building site: #{source} -> #{destination}"
puts " Source: #{source}"
puts " Destination: #{destination}"
print " Generating... "
begin
site.process
rescue Jekyll::FatalException => e
@ -33,7 +35,7 @@ module Jekyll
puts e.message
exit(1)
end
puts "Successfully generated site: #{source} -> #{destination}"
puts "done."
end
# Private: Watch for file changes and rebuild the site.