From 768dd05143c915af426e7edc0a304797d0bc5720 Mon Sep 17 00:00:00 2001 From: mbround18 <12646562+mbround18@users.noreply.github.com> Date: Thu, 4 Feb 2021 23:49:42 -0700 Subject: [PATCH] Check for server_exit --- src/commands/start.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/commands/start.rs b/src/commands/start.rs index 33211c2e..31317ad1 100644 --- a/src/commands/start.rs +++ b/src/commands/start.rs @@ -4,7 +4,7 @@ use clap::{ArgMatches}; use crate::utils::{get_variable, server_installed, get_working_dir}; use std::fs::{File, remove_file}; use std::io::Write; -use log::{info, error}; +use log::{info, error, debug}; use tinytemplate::TinyTemplate; use serde::Serialize; @@ -63,7 +63,12 @@ fn parse_arg(args: &ArgMatches, name: &str, default: &str) -> String { pub fn invoke(args: &ArgMatches) { let paths = &[get_working_dir(), "server_exit.drp".to_string()]; let server_exit = &paths.join("/"); - remove_file(server_exit).unwrap(); + match remove_file(server_exit) { + Ok(_) => info!("Deleted server exit file."), + Err(_) => { + debug!("Server exit file did no pre-exist. Good!") + } + }; let mut command = create_execution("bash"); let command_args: &str = &[