From 2dbe82ba5cec4fd67d173c52744290401f93238c Mon Sep 17 00:00:00 2001 From: Alex Rock Ancelet Date: Fri, 23 Dec 2022 14:15:18 +0100 Subject: [PATCH] Pass missing host to serve background --- CHANGELOG.md | 4 ++++ src/commands/serve.rs | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 78a4ce1..e97048d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +# v0.4.6 + +* Pass missing host to serve background command + # v0.4.5 * Update release process on github actions diff --git a/src/commands/serve.rs b/src/commands/serve.rs index d2d5f06..618c9a4 100644 --- a/src/commands/serve.rs +++ b/src/commands/serve.rs @@ -264,6 +264,11 @@ fn serve_background(args: &ArgMatches) -> ExitCode { cmd.arg("--passthru").arg(passthru); } + let host = args.get_one::("host").map(|s| s.as_str()).unwrap_or("").to_string(); + if host != "" { + cmd.arg("--host").arg(host); + } + let subprocess = cmd.spawn().expect("Failed to start server as a background process"); let pid = subprocess.id();