Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Accept multiple config files from command line #945

Merged
merged 3 commits into from Apr 12, 2013

Conversation

Projects
None yet
6 participants
@voidfiles
Copy link
Contributor

voidfiles commented Apr 10, 2013

Parse config as if it can contain multiple references to config files.
This allows you to pass in multiple config files from the command line

Helps with issues #514 and #703

Alex Kessinger
Accept multiple config files from command line
Parse config as if it can contain multiple references to config files.
This allows you to pass in multiple config files from the command line

Helps with issues #514 and #703
config_files = override.delete('config')
config_files = File.join(source, "_config.yml") if config_files.to_s.empty?
# If config is a list of space separate config files
config_files = config_files.split(' ')

This comment has been minimized.

Copy link
@parkr

parkr Apr 10, 2013

Member

I'm worried that this is no good in case someone has a space in their file path

This comment has been minimized.

Copy link
@parkr

parkr Apr 10, 2013

Member

Look into commander accepting an Array instead of String like it does right now in bin/jekyll

@voidfiles

This comment has been minimized.

Copy link
Contributor Author

voidfiles commented Apr 11, 2013

I ran the tests in ruby 1.8.7 and it passes for me I am not sure how I can replicate the travis env.

@maul-esel

This comment has been minimized.

Copy link
Contributor

maul-esel commented Apr 11, 2013

Passes for me as well. It's annoying that due to that SystemStackError you can't see what's actually wrong 😒

config_file = File.join(source, "_config.yml") if config_file.to_s.empty?
config_files = override.delete('config')
config_files = File.join(source, "_config.yml") if config_files.to_s.empty?
if not config_files.is_a? Array

This comment has been minimized.

Copy link
@parkr

parkr Apr 11, 2013

Member

please use !. @mojombo prefers to use the more C-like versions - no python allowed ;)

This comment has been minimized.

Copy link
@parkr

parkr Apr 11, 2013

Member

better yet, use unless

@@ -46,10 +46,20 @@ class TestConfiguration < Test::Unit::TestCase
assert_equal Jekyll::DEFAULTS.deep_merge({ "baseurl" => "http://wahoo.dev" }), Jekyll.configuration({ "config" => @paths[:other] })
end

should "load default config if path passed is empty" do
should "load multiple config files" do

This comment has been minimized.

Copy link
@parkr

parkr Apr 11, 2013

Member

wait. whyyyyy did you take my test?

This comment has been minimized.

Copy link
@voidfiles

voidfiles Apr 11, 2013

Author Contributor

I am not sure. I will change that.

@voidfiles

This comment has been minimized.

Copy link
Contributor Author

voidfiles commented Apr 11, 2013

funny, the tests passed this time.

@parkr

This comment has been minimized.

Copy link
Member

parkr commented Apr 12, 2013

LGTM, will ask for another pair of eyes

@mattr-

This comment has been minimized.

Copy link
Member

mattr- commented Apr 12, 2013

👍 :shipit:

parkr added a commit that referenced this pull request Apr 12, 2013

Merge pull request #945 from voidfiles/master
Accept multiple config files from command line

@parkr parkr merged commit 17c1e23 into jekyll:master Apr 12, 2013

1 check passed

default The Travis build passed
Details

parkr added a commit that referenced this pull request Apr 12, 2013

@benbalter

This comment has been minimized.

Copy link
Contributor

benbalter commented Apr 14, 2013

Are you able to replicate this behavior via command line? Can't get it to work. What am I doing wrong?

jekyll build --config _config.yml _config2.yml
Configuration file: _config.yml
...
@parkr

This comment has been minimized.

Copy link
Member

parkr commented Apr 14, 2013

The option should probably be --config FILE1, FILE2, ... or something. It specifies Array though. Hm.

@benbalter

This comment has been minimized.

Copy link
Contributor

benbalter commented Apr 14, 2013

Tried:

  • --config foo bar
  • --config foo, bar
  • --config [foo, bar] (also with quotes)
  • --config foo --config bar

No such luck.

@voidfiles

This comment has been minimized.

Copy link
Contributor Author

voidfiles commented Apr 14, 2013

--config FILE1,FILE2 no spaces, but I found some other problems as well. I have a patch I am about to push.

@voidfiles

This comment has been minimized.

Copy link
Contributor Author

voidfiles commented Apr 14, 2013

Here is a pull request that updates the command line description to make it a better example of how to do it. Also multi config files just weren't working.

#973

parkr added a commit that referenced this pull request Apr 14, 2013

parkr added a commit that referenced this pull request Apr 14, 2013

Merge branch 'master' of github.com:mojombo/jekyll
* 'master' of github.com:mojombo/jekyll:
  Print deprecation warnings for 'server', 'watch' and 'auto' when loaded from files. Fixes #972
  Fixes multiple config loading. Closes #973. Rel: #945.

@netpoetica netpoetica referenced this pull request Jun 20, 2013

Closed

No Async #21

@jekyll jekyll locked and limited conversation to collaborators Feb 27, 2017

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.