mirror of
https://github.com/timvisee/lazymc.git
synced 2025-05-19 12:50:23 -07:00
Make server directory option optional
This commit is contained in:
parent
db0552f2e5
commit
a5fbdc8d30
@ -91,7 +91,7 @@ pub struct Public {
|
||||
#[derive(Debug, Deserialize)]
|
||||
pub struct Server {
|
||||
/// Server directory.
|
||||
pub directory: PathBuf,
|
||||
pub directory: Option<PathBuf>,
|
||||
|
||||
/// Start command.
|
||||
pub command: String,
|
||||
|
@ -205,7 +205,9 @@ pub async fn invoke_server_command(
|
||||
// Build command
|
||||
let mut cmd = Command::new(args[0]);
|
||||
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);
|
||||
|
||||
info!(target: "lazymc", "Starting server...");
|
||||
|
Loading…
x
Reference in New Issue
Block a user