(&self, path: &Path)
| 78 | } |
| 79 | |
| 80 | pub fn create_custom(&self, path: &Path) -> anyhow::Result<()> { |
| 81 | if std::fs::symlink_metadata(self).is_ok_and(|m| m.file_type().is_dir()) { |
| 82 | anyhow::bail!("version already exists"); |
| 83 | } |
| 84 | self.link_to(path) |
| 85 | } |
| 86 | |
| 87 | fn link_to(&self, path: &Path) -> anyhow::Result<()> { |
| 88 | let rel_path = path.strip_prefix(self.0.parent().unwrap()).unwrap_or(path); |