From be3844432f5f1259e3e0e48fb7add242ac851572 Mon Sep 17 00:00:00 2001 From: Ruben Arts Date: Tue, 28 Nov 2023 12:33:25 +0100 Subject: [PATCH 1/3] wip: test spaced --- src/cli/global/install.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/cli/global/install.rs b/src/cli/global/install.rs index 1c1982b4d..885e51cba 100644 --- a/src/cli/global/install.rs +++ b/src/cli/global/install.rs @@ -501,3 +501,17 @@ fn is_bin_folder_on_path() -> bool { .into_iter() .contains(&bin_path) } + +#[cfg(test)] +mod tests { + use super::*; + #[test] + fn test_create_bin() { + let tmp_dir = tempfile::TempDir::new().unwrap(); + let spaced_dir = tmp_dir.path().join("Test Spaced"); + let prefix = Prefix::new(spaced_dir).unwrap(); + let script = + create_activation_script(&prefix, ShellEnum::Bash(Default::default())).unwrap(); + dbg!(script); + } +} From de5af5ce8e05604151ecbc8ca630905aa139c342 Mon Sep 17 00:00:00 2001 From: Ruben Arts Date: Tue, 28 Nov 2023 14:34:45 +0100 Subject: [PATCH 2/3] fix: quote the executable path --- src/cli/global/install.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cli/global/install.rs b/src/cli/global/install.rs index 885e51cba..e5e192678 100644 --- a/src/cli/global/install.rs +++ b/src/cli/global/install.rs @@ -294,7 +294,7 @@ pub(crate) async fn create_executable_scripts( .run_command( &mut script, [ - prefix.root().join(exec).to_string_lossy().as_ref(), + format!(r###""{}""###, prefix.root().join(exec).to_string_lossy()).as_str(), get_catch_all_arg(shell), ], ) From 458c4a57f654378c283a5f3db08b3195fc74e5f0 Mon Sep 17 00:00:00 2001 From: Ruben Arts Date: Tue, 28 Nov 2023 14:48:06 +0100 Subject: [PATCH 3/3] remove nonsense test --- src/cli/global/install.rs | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/src/cli/global/install.rs b/src/cli/global/install.rs index e5e192678..d8b33d079 100644 --- a/src/cli/global/install.rs +++ b/src/cli/global/install.rs @@ -501,17 +501,3 @@ fn is_bin_folder_on_path() -> bool { .into_iter() .contains(&bin_path) } - -#[cfg(test)] -mod tests { - use super::*; - #[test] - fn test_create_bin() { - let tmp_dir = tempfile::TempDir::new().unwrap(); - let spaced_dir = tmp_dir.path().join("Test Spaced"); - let prefix = Prefix::new(spaced_dir).unwrap(); - let script = - create_activation_script(&prefix, ShellEnum::Bash(Default::default())).unwrap(); - dbg!(script); - } -}