diff options
author | Canop <cano.petrole@gmail.com> | 2022-03-23 19:12:33 +0100 |
---|---|---|
committer | Canop <cano.petrole@gmail.com> | 2022-03-23 19:12:33 +0100 |
commit | f9fe6efebf3ce4e32d93705db8decc2019f7112f (patch) | |
tree | 370d4a08fa3685a247607d6329325e894669289f | |
parent | 2feccf9923eedafd64abcf48a59d277ce98fbda8 (diff) |
escape spaces in sourcing path in shell script install
Fix #520
(hopefully, not really tested)
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | src/cli/app_launch_args.rs | 1 | ||||
-rw-r--r-- | src/shell_install/bash.rs | 3 |
3 files changed, 3 insertions, 2 deletions
@@ -14,3 +14,4 @@ deploy.sh /trav /press /glassbench_*.db +.bacon-locations diff --git a/src/cli/app_launch_args.rs b/src/cli/app_launch_args.rs index a1fe479..03b25ae 100644 --- a/src/cli/app_launch_args.rs +++ b/src/cli/app_launch_args.rs @@ -1,4 +1,3 @@ - use { crate::{ tree::TreeOptions, diff --git a/src/shell_install/bash.rs b/src/shell_install/bash.rs index e98dbc3..7be3b31 100644 --- a/src/shell_install/bash.rs +++ b/src/shell_install/bash.rs @@ -128,7 +128,8 @@ pub fn install(si: &mut ShellInstall) -> Result<(), ProgramError> { si.skin.print_text(MD_NO_SOURCING); return Ok(()); } - let source_line = format!("source {}", &link_path.to_string_lossy()); + let escaped_path = link_path.to_string_lossy().replace(' ', "\\ "); + let source_line = format!("source {}", &escaped_path); for sourcing_path in &sourcing_paths { let sourcing_path_str = sourcing_path.to_string_lossy(); if util::file_contains_line(sourcing_path, &source_line)? { |