Fixed bug which meant config file did not override default source and destination

This commit is contained in:
mreid 2009-02-24 18:10:51 +11:00
parent 6edfae8c26
commit 9f3244e884
1 changed files with 6 additions and 6 deletions

View File

@ -62,17 +62,17 @@ end
opts.parse! opts.parse!
# Temporarily set source and destination options to read in config file # Temporarily set source and destination options to read in config file
options['source'] = Jekyll::DEFAULTS['source'] source = Jekyll::DEFAULTS['source']
options['destination'] = Jekyll::DEFAULTS['destination'] destination = Jekyll::DEFAULTS['destination']
# Get source and destintation from command line # Get source and destintation from command line
case ARGV.size case ARGV.size
when 0 when 0
when 1 when 1
options['destination'] = ARGV[0] destination = options['destination'] = ARGV[0]
when 2 when 2
options['source'] = ARGV[0] source = options['source'] = ARGV[0]
options['destination'] = ARGV[1] destination = options['destination'] = ARGV[1]
else else
puts "Invalid options. Run `jekyll --help` for assistance." puts "Invalid options. Run `jekyll --help` for assistance."
exit(1) exit(1)
@ -80,7 +80,7 @@ end
# Get configuration from <source>/_config.yaml # Get configuration from <source>/_config.yaml
config = {} config = {}
config_file = File.join(options['source'], '_config.yaml') config_file = File.join(source, '_config.yaml')
begin begin
config = YAML.load_file( config_file ) config = YAML.load_file( config_file )
puts "Configuration from #{config_file}" puts "Configuration from #{config_file}"