()
| 126 | }) |
| 127 | } |
| 128 | pub fn parse_config() -> eyre::Result<()> { |
| 129 | let config = Config::parse(); |
| 130 | CONFIG_INSTANCE.set(RwLock::new(config)).unwrap(); |
| 131 | let deopt = Deopt::new(get_library_name())?; |
| 132 | let data = deopt.get_library_data_dir()?; |
| 133 | if !data.exists() { |
| 134 | eyre::bail!( |
| 135 | "Cannot find the entry {} in `data` dir, please prepare it in anvance.", |
| 136 | deopt.config.project_name |
| 137 | ); |
| 138 | } |
| 139 | let lib = deopt.get_library_build_lib_path()?; |
| 140 | if !lib.exists() { |
| 141 | eyre::bail!("Cannot find the build library {} in `{}` dir, please build it by build.sh in anvance.", deopt.config.project_name, Deopt::get_crate_build_dir()?.display()); |
| 142 | } |
| 143 | Ok(()) |
| 144 | } |
| 145 | |
| 146 | /// Simple program to greet a person |
| 147 | #[derive(Parser, Debug)] |
no test coverage detected