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

Added dev args to wrangler.toml #1477

Merged
merged 3 commits into from
Aug 5, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
6 changes: 1 addition & 5 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -759,18 +759,14 @@ fn run() -> Result<(), failure::Error> {
);
let manifest = settings::toml::Manifest::new(config_path)?;

let mut host: Option<&str> = matches.value_of("host");
let host: Option<&str> = matches.value_of("host");
let mut ip: Option<&str> = matches.value_of("ip");
let mut port: Option<u16> = matches
.value_of("port")
.map(|p| p.parse().expect("--port expects a number"));

// Check if arg not given but present in wrangler.toml
if let Some(d) = &manifest.dev {
if host.is_none() && d.host.is_some() {
host = d.host.as_deref();
}

if ip.is_none() && d.ip.is_some() {
ip = d.ip.as_deref();
}
jspspike marked this conversation as resolved.
Show resolved Hide resolved
Expand Down
1 change: 0 additions & 1 deletion src/settings/toml/dev.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ use serde::{Deserialize, Serialize};
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct Dev {
pub host: Option<String>,
pub ip: Option<String>,
pub port: Option<u16>,
}