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

Commit

Permalink
suggest wrangler init if wrangler.toml does not exist
Browse files Browse the repository at this point in the history
  • Loading branch information
ashleymichal committed May 1, 2020
1 parent bae61d8 commit aba0165
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 @@ -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."
);
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 @@ -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")
}

0 comments on commit aba0165

Please sign in to comment.