| 12 | const LOCAL_DEPLOYED_ENGINE_VERSION: &str = "v0.0.0-local"; |
| 13 | |
| 14 | pub fn check_libs_directory(path: String) -> Result<(), EngineInitError> { |
| 15 | match fs::read_dir(path) { |
| 16 | Ok(out) => { |
| 17 | let is_empty = out.take(1).count() == 0; |
| 18 | match is_empty { |
| 19 | true => Err(EngineInitError::Regular(ErrorKind::LibsDirEmpty)), |
| 20 | false => Ok(()), |
| 21 | } |
| 22 | } |
| 23 | Err(_) => Err(EngineInitError::Regular(ErrorKind::LibsPathsMissing)), |
| 24 | } |
| 25 | } |
| 26 | |
| 27 | // check_versions_from will check (in file given in parameter) binaries versions |
| 28 | // will assert an error if used version installed is not the same as written in file |