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

Commit

Permalink
Merge pull request #1239 from cloudflare/feat/error-no-toml
Browse files Browse the repository at this point in the history
suggest `wrangler init` if wrangler.toml does not exist
  • Loading branch information
ashleymichal authored May 7, 2020
2 parents 063cf5d + 3f6f8b3 commit c27adcc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/settings/toml/manifest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,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."
);
let config = read_config(config_path)?;

let manifest: Manifest = match config.try_into() {
Expand Down
2 changes: 1 addition & 1 deletion src/settings/toml/tests/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -146,5 +146,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")
}

0 comments on commit c27adcc

Please sign in to comment.