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

Check for keys #192

Merged
merged 1 commit into from
Jun 1, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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