check value env variable SVDIR

This commit is contained in:
primardj 2024-04-05 22:00:23 +01:00
parent fad19ac060
commit a66357a179

View file

@ -7,6 +7,18 @@ use std::env;
fn main() { fn main() {
let args: Vec<String> = env::args().collect(); let args: Vec<String> = env::args().collect();
// def env variables.
let svdir_env = env::var("SVDIR");
//let svwait_env = env::var("SVWAIT");
let svdir_var = match svdir_env {
Ok(var) => var,
Err(..) => "/run/runit/service".to_string(),
};
dbg!(svdir_var);
// args // args
let arg_parser: Vec<String> = parser::parse_args(args); let arg_parser: Vec<String> = parser::parse_args(args);