more improvements
This commit is contained in:
@ -1,7 +1,10 @@
|
||||
use lazy_static::lazy_static;
|
||||
use num_enum::{IntoPrimitive, TryFromPrimitive};
|
||||
use satrs_mib::res_code::ResultU16Info;
|
||||
use satrs_mib::resultcode;
|
||||
use std::env;
|
||||
use std::net::Ipv4Addr;
|
||||
use std::path::{Path, PathBuf};
|
||||
|
||||
pub const STOP_FILE_NAME: &str = "stop-experiment";
|
||||
pub const HOME_FOLER_EXPERIMENT: &str = "/home/exp278";
|
||||
@ -26,6 +29,19 @@ pub enum GroupId {
|
||||
Action = 3,
|
||||
}
|
||||
|
||||
lazy_static! {
|
||||
pub static ref HOME_PATH: PathBuf = {
|
||||
let home_path_default = env::var("HOME").expect("HOME env variable not set");
|
||||
let mut home_path = PathBuf::new();
|
||||
home_path.push(if Path::new(HOME_FOLER_EXPERIMENT).exists() {
|
||||
HOME_FOLER_EXPERIMENT
|
||||
} else {
|
||||
&home_path_default
|
||||
});
|
||||
home_path
|
||||
};
|
||||
}
|
||||
|
||||
pub mod tmtc_err {
|
||||
use super::*;
|
||||
use satrs::res_code::ResultU16;
|
||||
|
Reference in New Issue
Block a user