Make server directory option optional
This commit is contained in:
parent
db0552f2e5
commit
a5fbdc8d30
@ -91,7 +91,7 @@ pub struct Public {
|
|||||||
#[derive(Debug, Deserialize)]
|
#[derive(Debug, Deserialize)]
|
||||||
pub struct Server {
|
pub struct Server {
|
||||||
/// Server directory.
|
/// Server directory.
|
||||||
pub directory: PathBuf,
|
pub directory: Option<PathBuf>,
|
||||||
|
|
||||||
/// Start command.
|
/// Start command.
|
||||||
pub command: String,
|
pub command: String,
|
||||||
|
@ -205,7 +205,9 @@ pub async fn invoke_server_command(
|
|||||||
// Build command
|
// Build command
|
||||||
let mut cmd = Command::new(args[0]);
|
let mut cmd = Command::new(args[0]);
|
||||||
cmd.args(args.iter().skip(1));
|
cmd.args(args.iter().skip(1));
|
||||||
cmd.current_dir(&config.server.directory);
|
if let Some(ref dir) = config.server.directory {
|
||||||
|
cmd.current_dir(dir);
|
||||||
|
}
|
||||||
cmd.kill_on_drop(true);
|
cmd.kill_on_drop(true);
|
||||||
|
|
||||||
info!(target: "lazymc", "Starting server...");
|
info!(target: "lazymc", "Starting server...");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user