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 #192 from cloudflare/check-for-keys
Browse files Browse the repository at this point in the history
Check for keys
  • Loading branch information
xtuc authored Jun 1, 2019
2 parents 2d0ca35 + 28d1e98 commit efd91f4
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/commands/publish/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,9 @@ fn publish_script(
project: &Project,
release: bool,
) -> Result<(), failure::Error> {
if project.account_id.is_empty() {
failure::bail!("You must provide an account_id in your wrangler.toml before you publish!")
}
let worker_addr = format!(
"https://api.cloudflare.com/client/v4/accounts/{}/workers/scripts/{}",
project.account_id, project.name,
Expand Down
9 changes: 9 additions & 0 deletions src/commands/publish/route.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,15 @@ struct RoutesResponse {

impl Route {
pub fn new(project: &Project) -> Result<Route, failure::Error> {
if project
.route
.clone()
.expect("You must provide a zone_id in your wrangler.toml before publishing!")
.is_empty()
{
failure::bail!("You must provide a zone_id in your wrangler.toml before publishing!");
}

Ok(Route {
script: Some(project.name.to_string()),
pattern: project.route.clone().expect("⚠️ Your project config has an error, check your `wrangler.toml`: `route` must be provided.").to_string(),
Expand Down

0 comments on commit efd91f4

Please sign in to comment.