Skip to content

Commit

Permalink
Fix a bug in the args of serve --daemon
Browse files Browse the repository at this point in the history
  • Loading branch information
Pierstoval committed Dec 23, 2022
1 parent 492eeb4 commit c088e6f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# v0.4.4

* Fix a bug in the arguments of `rymfony serve --daemon`

# v0.4.3

* Update all Rust dependencies
Expand Down
14 changes: 8 additions & 6 deletions src/commands/serve.rs
Original file line number Diff line number Diff line change
Expand Up @@ -253,13 +253,15 @@ fn serve_background(args: &ArgMatches) -> ExitCode {
if args.get_flag("expose-server-header") {
cmd.arg("--expose-server-header");
}
if args.get_flag("document-root") {
cmd.arg("--document-root")
.arg(args.get_one::<String>("document-root").map(|s| s.as_str()).unwrap_or("").to_string());

let document_root = args.get_one::<String>("document-root").map(|s| s.as_str()).unwrap_or("").to_string();
if document_root != "" {
cmd.arg("--document-root").arg(document_root);
}
if args.get_flag("passthru") {
cmd.arg("--passthru")
.arg(args.get_one::<String>("passthru").map(|s| s.as_str()).unwrap_or("index.php").to_string());

let passthru = args.get_one::<String>("passthru").map(|s| s.as_str()).unwrap_or("").to_string();
if passthru != "" {
cmd.arg("--passthru").arg(passthru);
}

let subprocess = cmd.spawn().expect("Failed to start server as a background process");
Expand Down

0 comments on commit c088e6f

Please sign in to comment.