(
&self,
canister: &str,
paths: &[String],
)
| 5 | |
| 6 | impl DfxOrbit { |
| 7 | pub(super) fn as_path_bufs( |
| 8 | &self, |
| 9 | canister: &str, |
| 10 | paths: &[String], |
| 11 | ) -> anyhow::Result<Vec<PathBuf>> { |
| 12 | if paths.is_empty() { |
| 13 | let canister_config = self.get_canister_config(canister)?; |
| 14 | let CanisterTypeProperties::Assets { source, .. } = &canister_config.type_specific |
| 15 | else { |
| 16 | bail!("Canister {canister} is not an asset canister"); |
| 17 | }; |
| 18 | Ok(source.clone()) |
| 19 | } else { |
| 20 | Ok(paths.iter().map(|source| PathBuf::from(&source)).collect()) |
| 21 | } |
| 22 | } |
| 23 | |
| 24 | pub(super) fn as_paths(paths: &[PathBuf]) -> Vec<&Path> { |
| 25 | paths.iter().map(|pathbuf| pathbuf.as_path()).collect() |
no test coverage detected