From dd7c5870d936ee37e4a1635058cf08efb84ea2d8 Mon Sep 17 00:00:00 2001 From: Parker Moore Date: Sun, 3 Feb 2013 20:29:58 +0100 Subject: [PATCH] Cleaner output when generating site. --- lib/jekyll.rb | 14 +++++++++----- lib/jekyll/commands/build.rb | 6 ++++-- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/lib/jekyll.rb b/lib/jekyll.rb index 2c1ab0e6..948dc72f 100644 --- a/lib/jekyll.rb +++ b/lib/jekyll.rb @@ -131,12 +131,16 @@ module Jekyll config_file = File.join(source, '_config.yml') begin config = YAML.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 - $stderr.puts "WARNING: Could not read configuration. " + - "Using defaults (and options)." - $stderr.puts "\t" + err.to_s + 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 diff --git a/lib/jekyll/commands/build.rb b/lib/jekyll/commands/build.rb index 0bb3c4f1..04942b77 100644 --- a/lib/jekyll/commands/build.rb +++ b/lib/jekyll/commands/build.rb @@ -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.