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

Throw if --config is specified but the file is not found #3373

Closed
LeaVerou opened this issue Jul 21, 2024 · 3 comments
Closed

Throw if --config is specified but the file is not found #3373

LeaVerou opened this issue Jul 21, 2024 · 3 comments
Labels
breaking-change This will have to be included with a major version as it breaks backwards compatibility. enhancement feature: CLI Related to command line flags/usage/features

Comments

@LeaVerou
Copy link

I periodically run into this, and it can be quite annoying, sometimes even destructive.

My 11ty build command usually looks like this:

npx @11ty/eleventy --config=somedir/eleventy.js 

The current behavior is that if 11ty doesn't find the file specified, it still builds, but using the default config.
This can create a lot of trash in the directory structure that I then need to remove manually.

I’d be inclined to consider it a bug: if I’ve explicitly specified a config file, I literally never want to build with the default config. If the config file I specified is not found, that’s a genuine error condition, and 11ty should just let me know and exit early (possibly by helpfully outputting CWD too or the full path it was trying).

@zachleat zachleat added enhancement feature: CLI Related to command line flags/usage/features labels Jul 22, 2024
@zachleat
Copy link
Member

I don’t think this is quite accurate! Both 2.x and 3.x alphas do not use any application configuration file when the provided one is not found.

image image

I think it’s fair to elevate this to an error though!

@zachleat zachleat added the breaking-change This will have to be included with a major version as it breaks backwards compatibility. label Jul 23, 2024
@zachleat zachleat added this to the Eleventy 3.0.0 milestone Jul 23, 2024
@zachleat
Copy link
Member

I did a bad job and linked to the wrong issue in the commit message d3d0361 but this will ship with 3.0.0-alpha.18—thank you!

zachleat added a commit that referenced this issue Jul 23, 2024
zachleat added a commit to 11ty/eleventy-upgrade-help that referenced this issue Jul 23, 2024
@zachleat zachleat added the needs-documentation Documentation for this issue/feature is pending! label Sep 20, 2024
zachleat added a commit to 11ty/11ty-website that referenced this issue Sep 26, 2024
@zachleat
Copy link
Member

@zachleat zachleat removed the needs-documentation Documentation for this issue/feature is pending! label Sep 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking-change This will have to be included with a major version as it breaks backwards compatibility. enhancement feature: CLI Related to command line flags/usage/features
Projects
None yet
Development

No branches or pull requests

2 participants