(host_shared_dir: impl Into<HostShareDir>)
| 269 | } |
| 270 | |
| 271 | fn load(host_shared_dir: impl Into<HostShareDir>) -> Result<Self> { |
| 272 | let host_shared_dir = host_shared_dir.into(); |
| 273 | let sys_config = deserialize_json_file(host_shared_dir.sys_config_file())?; |
| 274 | let app_compose = deserialize_json_file(host_shared_dir.app_compose_file())?; |
| 275 | let instance_info_file = host_shared_dir.instance_info_file(); |
| 276 | let instance_info = if instance_info_file.exists() { |
| 277 | deserialize_json_file(instance_info_file)? |
| 278 | } else { |
| 279 | InstanceInfo::default() |
| 280 | }; |
| 281 | let encrypted_env = fs::read(host_shared_dir.encrypted_env_file()).unwrap_or_default(); |
| 282 | Ok(Self { |
| 283 | dir: host_shared_dir.clone(), |
| 284 | sys_config, |
| 285 | app_compose, |
| 286 | encrypted_env, |
| 287 | instance_info, |
| 288 | }) |
| 289 | } |
| 290 | |
| 291 | fn copy(host_shared_dir: &Path, host_shared_copy_dir: &Path) -> Result<HostShared> { |
| 292 | const SZ_1KB: u64 = 1024; |
nothing calls this directly
no test coverage detected