(data_root_path: &Path)
| 27 | } |
| 28 | |
| 29 | pub fn create_directories_if_non_existent(data_root_path: &Path) { |
| 30 | if !data_root_path.exists() { |
| 31 | fs::create_dir_all(data_root_path).expect("Failed to create directories"); |
| 32 | } |
| 33 | |
| 34 | let public_data_folder = get_public_data_directory_path(data_root_path); |
| 35 | if !public_data_folder.exists() { |
| 36 | fs::create_dir(public_data_folder).expect("Failed to create 'public' directory"); |
| 37 | } |
| 38 | |
| 39 | let private_data_folder = get_private_data_directory_path(data_root_path); |
| 40 | if !private_data_folder.exists() { |
| 41 | fs::create_dir(private_data_folder).expect("Failed to create 'private' directory"); |
| 42 | } |
| 43 | } |
| 44 | |
| 45 | pub fn get_private_data_from_file(path: &Path) -> BitVMClientPrivateData { |
| 46 | match read_file(path) { |
no test coverage detected