Skip to content
This repository has been archived by the owner on Aug 3, 2023. It is now read-only.

suggest wrangler init if wrangler.toml does not exist #1239

Merged
merged 3 commits into from
May 7, 2020

Conversation

ashleymichal
Copy link
Contributor

closes #827

@ashleymichal ashleymichal requested a review from a team May 4, 2020 16:08
@ashleymichal ashleymichal self-assigned this May 4, 2020
@ashleymichal ashleymichal added this to the 1.9.0 milestone May 4, 2020
@@ -46,6 +46,10 @@ pub struct Manifest {

impl Manifest {
pub fn new(config_path: &Path) -> Result<Self, failure::Error> {
failure::ensure!(
config_path.exists(),
"wrangler.toml not found; run `wrangler init` to create one."
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: add link to docs about how to configure

@@ -147,5 +147,5 @@ fn base_fixture_path() -> PathBuf {
}

fn toml_fixture_path(fixture: &str) -> PathBuf {
base_fixture_path().join(fixture)
base_fixture_path().join(fixture).with_extension("toml")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is this change necessary?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

some magical thing in config crate was doing this for us when we went to use merge, but now that we first check config_path.exists() before we get to that point, the extension needs to be explicitly included in the path.

@ashleymichal ashleymichal merged commit c27adcc into master May 7, 2020
@delete-merged-branch delete-merged-branch bot deleted the feat/error-no-toml branch May 7, 2020 19:10
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

if no wrangler.toml found on build/preview/publish, give an error message to run wrangler init
2 participants