aboutsummaryrefslogtreecommitdiff
path: root/src/dotup.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/dotup.rs')
-rw-r--r--src/dotup.rs8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/dotup.rs b/src/dotup.rs
index 5f1287f..8de7920 100644
--- a/src/dotup.rs
+++ b/src/dotup.rs
@@ -132,7 +132,13 @@ impl Dotup {
132 pub fn link(&mut self, origin: impl AsRef<Path>, destination: impl AsRef<Path>) { 132 pub fn link(&mut self, origin: impl AsRef<Path>, destination: impl AsRef<Path>) {
133 let link_result: anyhow::Result<()> = try { 133 let link_result: anyhow::Result<()> = try {
134 let origin = self.prepare_relative_origin(origin.as_ref())?; 134 let origin = self.prepare_relative_origin(origin.as_ref())?;
135 let destination = self.prepare_relative_destination(destination.as_ref())?; 135 let destination_ends_with_slash = utils::path_ends_with_slash(destination.as_ref());
136 let mut destination = self.prepare_relative_destination(destination.as_ref())?;
137 if destination_ends_with_slash {
138 if let Some(filename) = origin.file_name() {
139 destination.push(filename);
140 }
141 }
136 self.depot.link_create(origin, destination)?; 142 self.depot.link_create(origin, destination)?;
137 }; 143 };
138 match link_result { 144 match link_result {