From 99a073af5a4001892fab2d36a8330579c4ad7f65 Mon Sep 17 00:00:00 2001 From: Vincenzo Palazzo Date: Mon, 26 Feb 2024 21:53:43 +0100 Subject: [PATCH 1/2] Revert "install command: add -T option to cp to not create nested folders on duplicate calls" This reverts commit 70de208c89165ee938a8b41b3d476783d83bdd1c. --- coffee_core/src/coffee.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/coffee_core/src/coffee.rs b/coffee_core/src/coffee.rs index 1bf247e..b79c4b2 100644 --- a/coffee_core/src/coffee.rs +++ b/coffee_core/src/coffee.rs @@ -270,7 +270,7 @@ impl PluginManager for CoffeeManager { old_root_path, new_root_path ); - let script = format!("cp -r -T {old_root_path} {new_root_path}"); + let script = format!("cp -r {old_root_path} {new_root_path}"); sh!(self.config.root_path.clone(), script, verbose); log::debug!( "Done! copying directory from {} inside the new one {}", From 6255f6ea7cbe617e79dd8288717813b39c10f2fc Mon Sep 17 00:00:00 2001 From: Vincenzo Palazzo Date: Mon, 26 Feb 2024 22:00:27 +0100 Subject: [PATCH 2/2] core: avoid creare recursive dir This is reverting a previous commit 70de208c89165ee938a8b41b3d476783d83bdd1c that it is not supported on OSX Signed-off-by: Vincenzo Palazzo --- coffee_core/src/coffee.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/coffee_core/src/coffee.rs b/coffee_core/src/coffee.rs index b79c4b2..f3e1d7e 100644 --- a/coffee_core/src/coffee.rs +++ b/coffee_core/src/coffee.rs @@ -270,7 +270,7 @@ impl PluginManager for CoffeeManager { old_root_path, new_root_path ); - let script = format!("cp -r {old_root_path} {new_root_path}"); + let script = format!("mkdir -p {new_root_path} || echo '{new_root_path} already exist' && cp -r {old_root_path}/ {new_root_path}"); sh!(self.config.root_path.clone(), script, verbose); log::debug!( "Done! copying directory from {} inside the new one {}",