Cleaner output when generating site.

This commit is contained in:
Parker Moore 2013-02-03 20:29:58 +01:00
parent e4042e56b7
commit dd7c5870d9
2 changed files with 13 additions and 7 deletions

View File

@ -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

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.