From 1c0dee8e60d9c1c989a3712e7d1e19debe981e8a Mon Sep 17 00:00:00 2001 From: diogo464 Date: Wed, 14 Jul 2021 15:07:32 +0100 Subject: Small changes to logging and docs. --- dotup_cli/src/commands/init.rs | 6 +++--- dotup_cli/src/commands/link.rs | 5 ++++- 2 files changed, 7 insertions(+), 4 deletions(-) (limited to 'dotup_cli/src/commands') 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 {} pub fn main(config: Config, opts: Opts) -> anyhow::Result<()> { if !dotup::utils::is_file(&config.archive_path)? { let archive = Archive::default(); - log::info!("Creating archive"); + log::info!("Creating archive at {}", &config.archive_path.display()); utils::write_archive(&config.archive_path, &archive)?; } else { - log::info!( - "Archive file already exists : {}", + log::warn!( + "Archive file already exists : '{}'", config.archive_path.display() ); } 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( .strip_prefix(base_canonical) .expect("Failed to remove prefix from origin path"); let destination = destination.join(partial); + let origin = origin_canonical + .strip_prefix(depot.base_path()) + .unwrap_or(&origin_canonical); let link_params = LinkCreateParams { - origin: origin_canonical, + origin: origin.to_path_buf(), destination, }; params.push(link_params); -- cgit