aboutsummaryrefslogtreecommitdiff
path: root/dotup_cli/src/commands
diff options
context:
space:
mode:
authordiogo464 <[email protected]>2021-07-14 15:07:32 +0100
committerdiogo464 <[email protected]>2021-07-14 15:07:32 +0100
commit1c0dee8e60d9c1c989a3712e7d1e19debe981e8a (patch)
tree07997fddae442679c90914b2c4abe3c953250838 /dotup_cli/src/commands
parent4adc2435da7d58cd34b9f1706b3cea9fb524b946 (diff)
Small changes to logging and docs.
Diffstat (limited to 'dotup_cli/src/commands')
-rw-r--r--dotup_cli/src/commands/init.rs6
-rw-r--r--dotup_cli/src/commands/link.rs5
2 files changed, 7 insertions, 4 deletions
diff --git a/dotup_cli/src/commands/init.rs b/dotup_cli/src/commands/init.rs
index 8765dbf..b894924 100644
--- a/dotup_cli/src/commands/init.rs
+++ b/dotup_cli/src/commands/init.rs
@@ -11,11 +11,11 @@ pub struct Opts {}
11pub fn main(config: Config, opts: Opts) -> anyhow::Result<()> { 11pub fn main(config: Config, opts: Opts) -> anyhow::Result<()> {
12 if !dotup::utils::is_file(&config.archive_path)? { 12 if !dotup::utils::is_file(&config.archive_path)? {
13 let archive = Archive::default(); 13 let archive = Archive::default();
14 log::info!("Creating archive"); 14 log::info!("Creating archive at {}", &config.archive_path.display());
15 utils::write_archive(&config.archive_path, &archive)?; 15 utils::write_archive(&config.archive_path, &archive)?;
16 } else { 16 } else {
17 log::info!( 17 log::warn!(
18 "Archive file already exists : {}", 18 "Archive file already exists : '{}'",
19 config.archive_path.display() 19 config.archive_path.display()
20 ); 20 );
21 } 21 }
diff --git a/dotup_cli/src/commands/link.rs b/dotup_cli/src/commands/link.rs
index ed7ee55..4c1ae06 100644
--- a/dotup_cli/src/commands/link.rs
+++ b/dotup_cli/src/commands/link.rs
@@ -106,9 +106,12 @@ fn link_file(
106 .strip_prefix(base_canonical) 106 .strip_prefix(base_canonical)
107 .expect("Failed to remove prefix from origin path"); 107 .expect("Failed to remove prefix from origin path");
108 let destination = destination.join(partial); 108 let destination = destination.join(partial);
109 let origin = origin_canonical
110 .strip_prefix(depot.base_path())
111 .unwrap_or(&origin_canonical);
109 112
110 let link_params = LinkCreateParams { 113 let link_params = LinkCreateParams {
111 origin: origin_canonical, 114 origin: origin.to_path_buf(),
112 destination, 115 destination,
113 }; 116 };
114 params.push(link_params); 117 params.push(link_params);