diff options
| author | diogo464 <[email protected]> | 2021-07-09 10:51:13 -0400 |
|---|---|---|
| committer | diogo464 <[email protected]> | 2021-07-09 10:51:13 -0400 |
| commit | a567cffa4167b92f8636ee2ba1a57ceaf3324e4e (patch) | |
| tree | 441c5899d84d4743851554de4b83dc8e9bc8f4c3 /dotup_cli | |
| parent | db42ce18a26c4b457086602ae0a1d0ca95ca55cf (diff) | |
Allow parsing depot files with link errors.
If there is an error while creating the links after reading from file
then a warning is printed and that link is ignored.
Diffstat (limited to 'dotup_cli')
| -rw-r--r-- | dotup_cli/src/utils.rs | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/dotup_cli/src/utils.rs b/dotup_cli/src/utils.rs index 706266e..1ac8c95 100644 --- a/dotup_cli/src/utils.rs +++ b/dotup_cli/src/utils.rs | |||
| @@ -78,9 +78,17 @@ pub fn read_depot(archive_path: impl AsRef<Path>) -> anyhow::Result<Depot> { | |||
| 78 | let archive = read_archive(&archive_path)?; | 78 | let archive = read_archive(&archive_path)?; |
| 79 | let depot_config = DepotConfig { | 79 | let depot_config = DepotConfig { |
| 80 | archive_path, | 80 | archive_path, |
| 81 | archive, | 81 | archive: Default::default(), |
| 82 | }; | 82 | }; |
| 83 | let depot = Depot::new(depot_config)?; | 83 | let mut depot = Depot::new(depot_config)?; |
| 84 | |||
| 85 | for archive_link in archive.links { | ||
| 86 | let link_params = LinkCreateParams::from(archive_link); | ||
| 87 | if let Err(e) = depot.create_link(link_params) { | ||
| 88 | log::warn!("Error while adding link : {}", e); | ||
| 89 | } | ||
| 90 | } | ||
| 91 | |||
| 84 | Ok(depot) | 92 | Ok(depot) |
| 85 | } | 93 | } |
| 86 | 94 | ||
