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

Crash if a specified config file isn't there #1098

Merged
merged 3 commits into from Jul 12, 2013

Conversation

Projects
None yet
4 participants
@parkr
Member

parkr commented May 13, 2013

If a configuration file is specified via the command line but does not exist,
fail loudly and crash to preserve the current state. Do not fail if the requested
file is the default configuration file, _config.yml. In that case, fall back on
the defaults.

//cc @benbalter @mattr-

@parkr

This comment has been minimized.

Member

parkr commented May 14, 2013

Thoughts, guys?

@benbalter

This comment has been minimized.

Contributor

benbalter commented May 14, 2013

Can't tell for sure, but if I say hey, Jekyll, use _config.yml, but override everything in it with _defaultz.yml (which doesn't exist)... since files is still a string, will it error out? I will it run with the non-overridden options?

@parkr

This comment has been minimized.

Member

parkr commented May 14, 2013

It will error out if _defaultz.yml doesn't exist, but will just return an empty {} if _config.yml doesn't exist and you specify jekyll build --config _config.yml,_defaultz.yml.

@benbalter

This comment has been minimized.

Contributor

benbalter commented May 14, 2013

👍 think that's a lot saner approach.

@mattr-

This comment has been minimized.

Member

mattr- commented May 14, 2013

I'm cool with this, except that I think it's a 1.1 change instead of a 1.0.3 change

@parkr

This comment has been minimized.

Member

parkr commented May 14, 2013

Agreed, this should totally be 1.1. Maybe that can be the next release after 1.0.3? We'll have to let this sit until we're ready to start working on 1.1.

@parkr

This comment has been minimized.

Member

parkr commented Jun 30, 2013

Going to rebase so we can merge for 1.1.

@parkr

This comment has been minimized.

Member

parkr commented Jun 30, 2013

@mattr- What do you think? I think it's ready to go.

@benbalter

This comment has been minimized.

Contributor

benbalter commented Jun 30, 2013

Will this catch if either config file is invalid YML and can't be parsed? (or would that be a separate issue)?

@parkr

This comment has been minimized.

Member

parkr commented Jun 30, 2013

It does catch invalid YAML in the block above the change that I made here.

@mattr-

This comment has been minimized.

Member

mattr- commented Jul 1, 2013

The build fails on Travis CI due to what look like legitimate reasons.

@ghost ghost assigned parkr Jul 3, 2013

parkr added some commits May 13, 2013

Crash if a config file isn't there.
If a configuration file is specified via the command line but does not exist,
fail loudly and crash to preserve the current state. Do not fail if the requested
file is the default configuration file, _config.yml. In that case, fall back on
the defaults.
@parkr

This comment has been minimized.

Member

parkr commented Jul 12, 2013

Ok I think I have it the way I want it. Thoughts?

@mattr-

This comment has been minimized.

Member

mattr- commented Jul 12, 2013

LGTM!! :shipit:

cobyism referenced this pull request in fitztrev/shuttle Jul 12, 2013

@benbalter

This comment has been minimized.

Contributor

benbalter commented Jul 12, 2013

👍 unless you want a test case for invalid YAML which came up as recently as today in fitztrev/shuttle@b25958c.

@parkr

This comment has been minimized.

Member

parkr commented Jul 12, 2013

His YAML is valid by safe_yaml which works for us. What are you using and can we sync? Sounds like that problem was due to the difference in YAML parsers.

~/code/shuttle$ irb
>> require 'safe_yaml'
=> true
>> YAML.safe_load_file("_config.yml")
=> {"tagline"=>"A simple SSH shortcut menu for OS X", "exclude"=>["*.jade", "*.less", "bootstrap", "bootstrap-glyphicons"]}

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

Merge pull request #1098 from mojombo/catch-missing-configs
Crash if a specified config file isn't there

@parkr parkr merged commit 87a3774 into master Jul 12, 2013

1 check passed

default The Travis CI build passed
Details

@parkr parkr deleted the catch-missing-configs branch Jul 12, 2013

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

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