Added some fixes for the Linux installer/service - now shipping a log4rs config; creates /var/log for log files; fixed name of service file
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
ci/woodpecker/tag/woodpecker Pipeline was successful

This commit is contained in:
2022-10-26 09:58:46 -04:00
parent b97a4b1c0f
commit 75d71e9695
5 changed files with 33 additions and 4 deletions

View File

@ -12,6 +12,10 @@ mod util;
#[derive(Parser)]
#[clap(author, version, about, long_about = None)]
struct Cli {
/// Number of times to greet
#[clap(short = 'l', long, default_value_t = String::from("./log4rs.yaml"))]
log_config: String,
#[clap(subcommand)]
command: Option<Commands>,
}
@ -23,12 +27,13 @@ enum Commands {
}
fn main() {
// initialize the log4rs logger
log4rs::init_file("./log4rs.yaml", Default::default()).unwrap();
// initialize the clap CLI
let cli = Cli::parse();
// grab the log4rs config file path, then initialize log4rs
let log4rs_config: String = cli.log_config;
log4rs::init_file(&log4rs_config, Default::default()).unwrap();
match &cli.command {
// sub-commands will be handled here
Some(Commands::Setup {}) => cmd::core::setup_command(),